forked from pReya/cursed-programming-stickers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
toolkit.nu
155 lines (123 loc) · 4.85 KB
/
toolkit.nu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Given a url to a pull request against a repo in our fork network, then apply the diff and make a commit
export def import-pull-request [
pull_request # Url to a pull request (eg <https://github.com/mkrl/misbrands/pull/86>)
] {
let pull_request_data = $pull_request
| parse "{rest}github.com/{user}/{repo}/pull/{pull_request_id}"
| first
| http get $"https://api.github.com/repos/($in.user)/($in.repo)/pulls/($in.pull_request_id)"
let message = $pull_request_data.title
let user = $pull_request_data.user.login
let url = ($pull_request_data.head.repo.html_url? | default deleted)
let commit_message = $"($message) \(credit @($user)) <($url)>"
http get $pull_request_data.diff_url | git apply
git add -A
git commit -m $commit_message
}
export def update-readme [] {
$"![An assortment of various logos that look like other famous brands but actually have their competitors' name]\(https://repository-images.githubusercontent.com/765213285/cb859884-eeb2-462a-a50c-8976873d4cb4)
<details>
<summary>
Timeline
</summary>
- May 2019: @samdbeckham's legendary javascript-java sticker \([website]\(https://samdbeckham.gitlab.io/javascript_sticker/)) \([tweet]\(https://twitter.com/samdbeckham/status/1129722966118457344))
- Aug 2019: @mkrl's misbrand repo \([repo]\(https://github.com/mkrl/misbrands))
- May 2022: @ohmyhub's fork \([repo]\(https://github.com/ohmyhub/misbrands))
- Feb 2024: @pReya's fork \([repo]\(https://github.com/pReya/cursed-programming-stickers))
- Mar 2024: This fork!
</details>
<details>
<summary>
FAQ
</summary>
### Can I print these?
Of course, that's why those are here.
### Can I buy these?
Yes, you can! Not from me, but from any custom sticker vendor of your choice.
### Will there be more?
This is a fork of the original repo that hadn't been updated in some time. I'm
working on adding new logos that were submitted as pull requests to the original
repo.
### How do I make a misbrand?
To make a misbrand, choose two existing brands. Generally the fanbase for the
brands have as much overlap \(eg: Rust & Golang) and/or contention \(eg: Vim & VSCode)
as possible or the brands have similar market niches \(eg: OpenVPN & NordVPN).
Once the two victum brands are chosen. Take the style \(eg: theme/design) of one
brand and join it with the text of the other brand. Viola!
Check the FAQ for more resources on DIY-ing a misbrand
### How do I find images/logos for brands?
- Look for the 'Press' or 'Media' section on the website, there will usually be assets that make a good starting place
- Search the codebase for `svg`
### How do I create an svg?
If you don't know where to start, use Inkscape \([website]\(https://inkscape.org))
\([gitlab]\(https://gitlab.com/inkscape/inkscape)). There are tutorials and resources
online, just search for 'How do I do XYZ in inkscape?'
### I have a misbrand. How do I contribute?
There are two ways to submit a misbrand:
- Issue: Create an issue on this repo with the image!
- Pull Request: Click the fork button, add the image to your copy of this repo, go to 'Pull Requests' and click 'New pull requests'
- Please follow the file and commit conventions below
</details>
<details>
<summary>
Naming Convention
</summary>
There are two naming conventions:
- One for files to make them easier to find and understand
- One for submitting images you didn't create
### Files
For all the images, our convention is
- `{text}-{style}.svg`
Example: The text says python in the logo style of php. `python-php.svg`
If there is a file with that name already existing simply add a dash and a
number starting with 02 and incrementing up from there.
Example: You submit a misbrand that says emacs in the style of the vim,
there is already an `emacs-vim.svg` in the repo. Name your file `emacs-vim-02.svg`.
### Commits
- If you created the image, do whatever you want for the commit message!
- If you are adding an image you didn't create, structure the message like so:
- `{text} in the style of {style} \(credit @{user}) <{url}>`
- Where `{user}` is the user who created the image
- And `{url}` is the repo/website the image came from
</details>
<details>
<summary>
Misbrands
</summary>
(misbrands-as-md)
</details>
"
| save -f README.md
}
export def misbrands-as-md [] {
misbrands
| group-by --to-table text
| each {|it|
[
'<details>'
'<summary>'
$it.group
'</summary>'
''
...($it.items | each { misbrand-as-md })
'</details>'
]
}
| flatten
| str join (char newline)
}
export def misbrand-as-md [] {
$"### ($in.style)(char newline)![($in.style)]\(($in.path))(char newline)"
}
export def misbrands [] {
ls *
| where name =~ '(png|svg)$'
| each {|it|
$it.name
| parse -r '^(?<text>[^-]+)-(?<style>[^-]+)-?(?<index>\d+)?\.(?<type>.+)$'
| get -i 0
| default {}
| update index { if ($in | is-empty) { 1 } else { into int } }
| insert path $it.name
}
}