Skip to content

Instantly share code, notes, and snippets.

View jedrekk's full-sized avatar
🐘
We do these things not because they are easy, but we thought they would be easy

Jędrek Kostecki jedrekk

🐘
We do these things not because they are easy, but we thought they would be easy
View GitHub Profile
var Input = React.createClass({
render() {
<input onFocus={ this.props.changeClassFunc } />
}
});
var OuterDiv = React.createClass({
javascript:%20var%20x=%20$(%22.content%22).find(%22a%22).each(function()%7Bvar%20href=$(this).attr(%22href%22);if((!$(this).hasClass(%22drowsapMorphed%22))%20&&%20($(this).next(%22.drowsapMorphed%22).length==0)%20&&%20href%20&&%20(href.indexOf('imgur')%3E=0%20%7C%7C%20href.indexOf('jpeg')%3E=0%20%7C%7C%20href.indexOf('jpg')%3E=0%20%7C%7C%20href.indexOf('png')%3E=0))%7Bvar%20ext%20=(href.indexOf('imgur')%3E=0%20&&%20href.indexOf('jpg')%3C0%20&&%20href.indexOf('png')%3C0)%20?%20'.jpg'%20:'';%20var%20img%20=%20$(%22%3Ca%20class='drowsapMorphed'%20href='%22+href+%22'%20target='blank'%20style='display:block'%3E%3Cimg%20style='display:block;max-width:780px;'%20src='%22+href+%20ext+%22'%20/%3E%3C/a%3E%22);$(this).after(img);%7D%7D);
@jedrekk
jedrekk / get_image_size_css.sh
Last active April 27, 2018 15:40
Get image file resolutions in Mac OS
sips -g pixelHeight -g pixelWidth *1x.png | perl -pe's/.*\///;s/\@1x.png\n/,/;s/\s+pixelHeight\:\s([0-9]+)\n/$1,/;s/\s+pixelWidth\:\s//;' | perl -npe 's/(.*),([0-9]+),([0-9]+)/&.$1 div.img { width: $2px; @include pseudo-image($2, $3, \"..\/img\/characters\/$1\@1x.png\", "..\/img\/characters\/$1\@2x.png"); }/'
<script>
import EventBus from '@/services/event-bus'
export default {
name: 'NewPopover',
computed: {},
watch: {
showPopper (newVal, oldVal) {
if (newVal) {
this.disableBusListener()
@jedrekk
jedrekk / spelling_bee_nyt.py
Created October 11, 2020 16:25
Find all words matching the NY Times Spelling Bee letters
# words4.txt is a wordlist of 4 letter or longer words
# usage: spelling_bee_nyt.py A BCDEFG
# where A is the required letter
#!/usr/bin/python3
import sys
magic_letter = sys.argv[1]
other_letters = sys.argv[2]
const arr1 = [
["name", "id", "age", "weight", "cool"],
["Susan", "3", "20", "120", true],
["John", "1", "21", "150", true],
["Bob", "2", "23", "90", false],
["Ben", "4", "20", "100", true],
];
const arr2 = [
["name", "id", "height"],
@jedrekk
jedrekk / rem_to_em.py
Created January 24, 2021 14:29
Converts rem to em units, multiplying them by 1.6
#!/usr/bin/python3
import sys
import re
from decimal import Decimal
file_name = sys.argv[1]
file = open(file_name)
lines = file.read()
file.close()
### Keybase proof
I hereby claim:
* I am jedrekk on github.
* I am jedrekkostecki (https://keybase.io/jedrekkostecki) on keybase.
* I have a public key ASDjwCG8O8hbWecE-VbTYn1zamf94UClknSpBDJP1lJtWQo
To claim this, I am signing this object: