View gist:939df8c7f81aa4039d517d6dbf908e22
# ┌───────────── minute (0 - 59) | |
# │ ┌───────────── hour (0 - 23) | |
# │ │ ┌───────────── day of month (1 - 31) | |
# │ │ │ ┌───────────── month (1 - 12) | |
# │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday; | |
# │ │ │ │ │ 7 is also Sunday on some systems) | |
# │ │ │ │ │ | |
# │ │ │ │ │ | |
# * * * * * command_to_execute |
View png-to-jpg.sh
for i in *.png ; do convert "$i" "${i%.*}.jpg" ; done |
View editor.php
<?php | |
/** | |
* Filter TinyMCE Buttons | |
* | |
* Here we are filtering the TinyMCE buttons and adding a button | |
* to it. In this case, we are looking to add a style select | |
* box (button) which is referenced as "styleselect". In this | |
* example we are looking to add the select box to the second | |
* row of the visual editor, as defined by the number 2 in the |
View list.twig
{# Loop through all items in a list, comma-separate them, but use "and" before the last item | |
e.g. ["apples", "bananas, "carrots] becomes "apples, bananas, and carrots" #} | |
{% macro to_sentence(items) %} | |
{% for item in items %} | |
{# First item #} | |
{% if loop.first %} | |
<span>{{ item }}{% if items|length > 2 %},{% endif %}</span> | |
{% else %} |
View php.json
{ | |
"Dump variable": { | |
"prefix": "pr", | |
"body": [ | |
"echo '<pre>';", | |
"print_r($1);", | |
"echo '</pre>';" | |
] | |
} | |
} |
View scss.json
{ | |
"@include media-breakpoint-only(xs)": { | |
"description": "Bootstrap media query for 'xs' only", | |
"prefix": "=xs", | |
"body": [ | |
"@include media-breakpoint-only(xs) {", | |
"\t$1", | |
"}" | |
] | |
}, |
View twig.json
{ | |
"Dump variable": { | |
"prefix": "dump", | |
"body": [ | |
"<pre>", | |
"\t{{dump($1)}}", | |
"</pre>" | |
] | |
} | |
} |
View gist:6026c8c04497909b8196c3e031f026b4
### Keybase proof | |
I hereby claim: | |
* I am jonnymaceachern on github. | |
* I am jonnymaceachern (https://keybase.io/jonnymaceachern) on keybase. | |
* I have a public key whose fingerprint is 6A78 AA59 B2AD 89D9 C60D 0EB3 73C0 1EBB 9860 CAA3 | |
To claim this, I am signing this object: |
View batch-convert-mp4-webm.sh
for i in *.mp4; | |
do name=`echo "$i" | cut -d'.' -f1` | |
echo "$name" | |
ffmpeg -i "$i" -acodec libvorbis -aq 5 -ac 2 -qmax 25 -threads 2 "${name}.webm" | |
done |
View equalize.js
var cousins = []; | |
// Find all elements that begin with class and return just that matching class | |
$('[class^=equalize-').each(function(index, el, array) { | |
var group = $(el).attr('class').match(/\bequalize-[\S]*/); | |
if ( group.length ) { | |
cousins.push( group[0] ); | |
} | |
}); |
NewerOlder