This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function simpleUpload( destination, filename, filetype, data ) { | |
var formData = new FormData(); | |
var blob = new Blob([data], { type: filetype }); | |
formData.append('file', blob, filename); | |
var request = new XMLHttpRequest(); | |
request.open('POST', destination); | |
request.send(formData); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! modernizr 3.3.1 (Custom Build) | MIT * | |
* http://modernizr.com/download/?-formvalidation-setclasses !*/ | |
!function(e,n,t){function o(e,n){return typeof e===n}function a(){var e,n,t,a,i,s,r;for(var l in f)if(f.hasOwnProperty(l)){if(e=[],n=f[l],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;t<n.options.aliases.length;t++)e.push(n.options.aliases[t].toLowerCase());for(a=o(n.fn,"function")?n.fn():n.fn,i=0;i<e.length;i++)s=e[i],r=s.split("."),1===r.length?Modernizr[r[0]]=a:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=a),d.push((a?"":"no-")+r.join("-"))}}function i(e){var n=u.className,t=Modernizr._config.classPrefix||"";if(c&&(n=n.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+t+"no-js(\\s|$)");n=n.replace(o,"$1"+t+"js$2")}Modernizr._config.enableClasses&&(n+=" "+t+e.join(" "+t),c?u.className.baseVal=n:u.className=n)}function s(){return"function"!=typeof n.cr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on alfred_script(q) | |
if not (q starts with "http://") | |
set q to "http://" & q | |
end if | |
tell application "/Applications/Google Chrome.app" | |
make new window | |
set URL of active tab of window 1 to q | |
end tell | |
end alfred_script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function help() { | |
echo "batch-rename allows you to rename a bulk of filenames with RegEx" | |
echo "usage: batch-rename -r [Search] [Replace]" | |
echo "param -r: do effective renaming instead of just showing what would be done" | |
} | |
function dummyRename() { | |
echo "simulate renaming \"$1\" to \"$2\"" | |
for file in * ; do echo "simulate: $file ->" "`echo $file | sed -E "s/$1/$2/g"`" ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example: replace every capital letter with 'abc', only changing m4a-files | |
for file in *.m4a ; do mv -vf "$file" "`echo $file | sed -E 's/[A-Z]/abc/g'`" ; done | |
// Sublime-Text snippet: | |
<snippet> | |
<content><![CDATA[ | |
for file in *.${1:m4a} ; do mv -vf "\$file" "`echo \$file | sed -E 's/${2:[A-Z]}/${0:abc}/g'`" ; done | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>rename</tabTrigger> |