This file contains hidden or 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 simpleIf(fun_if, fun_else) { | |
if(!fun_if()) fun_else(); | |
} | |
//usage | |
simpleIf(function(){ | |
console.log('doing stuff because Im true!'); | |
return true; | |
}, function(){ | |
console.log('some more stuff :('); |
This file contains hidden or 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 | |
# Converts a file from mkv to mp4. | |
# Shortcut for the following | |
# HandBrakeCLI --preset="Normal" -i Zombieland-720P.mkv -o Zombieland-720P.mp4 -O | |
# | |
# Usage: mkv2mp4 sourcefile.mkv | |
output=`echo $1|sed -e "s/.mkv/.mp4/gi"` | |
echo "Encoding $output" |
This file contains hidden or 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
var test = require('./title_var'); | |
test.title = "kJSDBGKJSDBgkjdfg"; |
This file contains hidden or 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
var form = new formidable.IncomingForm(), | |
files = []; | |
form.uploadDir = config.tmpPath; | |
form.maxFieldsSize = config.maxUploadSize; | |
form | |
.on('file', function(field, file) { | |
files.push([field, file]); | |
}) |
This file contains hidden or 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
/** | |
* Shows just the (tool)tip. | |
* | |
* Example: | |
* | |
* var tooltip = new TooltipClass({ | |
* selector: '.tipped' | |
* }); | |
* | |
* To inject content into the tooltip, place a data-tooltip attribute that matches the selector. |
This file contains hidden or 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
[core] | |
autocrlf = input | |
[alias] | |
d=diff --color | |
lg=log --graph --oneline --no-merges --pretty=format:'%Cred%h%Creset - %s %Cgreen(%an - %cr)%Creset %C(yellow)%d%Creset' --abbrev-commit | |
lf=log --name-only --oneline --no-merges --pretty=format:'%Cred%h%Creset - %s %Cgreen(%an - %cr)%Creset %C(yellow)%d%Creset' --abbrev-commit | |
lb=!git l --branches | |
cmp = !sh -c 'git log --left-right --oneline --no-merges --pretty=format:\"%m %Cred%h%Creset - %s %Cgreen(%an - %cr)%Creset %C(yellow)%d%Creset\" $0...' | |
br="!sh -c 'git fetch origin;git checkout --no-track -b feature/${0/#feature\\//} origin/master'" | |
mb2=merge --squash |
This file contains hidden or 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
{ | |
"color_scheme": "Packages/User/Espresso Soda.tmTheme", | |
"default_line_ending": "unix", | |
"file_exclude_patterns": | |
[ | |
"*.pyc", | |
"*.pyo", | |
"*.exe", | |
"*.dll", | |
"*.obj", |
This file contains hidden or 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
RewriteEngine on | |
RewriteBase / | |
RewriteCond % {REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html | |
RewriteRule ^/([^/]+)\.html$ /$1/ [R=301,L] |
This file contains hidden or 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
http.createServer(function(req, res){ | |
var path = './images/' + Math.ceil(Math.random()*4) | |
var img = fs.readFileSync(path + '.jpg'); | |
res.writeHead(200, {'Content-Type': 'image/jpg' }); | |
res.end(img, 'binary'); | |
}).listen(80, '127.0.0.1'); |
This file contains hidden or 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 run {input, parameters} | |
repeat with movieFile in input | |
try | |
if name extension of (info for movieFile) is "mp4" then | |
tell application "iFlicks" | |
import movieFile as QuickTime movie with deleting | |
end tell | |
else if name extension of (info for movieFile) is "mkv" then |