View test.js
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 foo (options, meta, callback) { | |
console.log(options.propOne) | |
console.log(options.propTwo[0].foo) | |
console.log(options.propTwo[0].bar) | |
console.log(options.propThree.subProp.hello) | |
meta.foo = 'bar' | |
} | |
// A IDE could extract the structure of `options` as JSON | |
// and copy that structure into the clipboard (functionality could be found in a context menu for example) |
View .babelrc.json
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
{ | |
"presets": [ | |
[ | |
"env", | |
{ | |
"targets": { | |
"node": "6.10" | |
} | |
} | |
], |
View gist:5f9ed341fbc9ce7c43aa
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() { | |
// fileinput bei android deaktivieren | |
if(!navigator.userAgent.match(/Android/i)) { | |
$.getScript("/sites/all/themes/fragnebenan/js/fileinput.min.js", function(){ | |
console.log('fileinput laden'); | |
}); | |
} | |
}) | |
// oder |
View gist:fcec40e289bd40d9461a
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() { | |
console.log('ich werde ausgeführt wenn alle DOM ready und alles geladen ist') | |
function triggerColLeftIcon(){ | |
$('.col-icon-left').css({'display':'none!important'}); | |
$('.col-icon-right').css({'display':'block!important'}); | |
} | |
function triggerColRightIcon(){ | |
$('.col-icon-right').css({'display':'none!important'}); | |
$('.col-icon-left').css({'display':'block!important'}); | |
} |
View backup.sh
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 | |
export FTP_PASSWORD="123456" | |
FTP_USER="user" | |
FTP_HOST="user.your-backup.de" | |
BACKUP_TARGET="ftp://${FTP_USER}@${FTP_HOST}/$(hostname)" | |
DUPLICITY_LOGFILE="/var/log/duplicity.log" | |
DUPLICITY_TEMPDIR="/tmp/duplicity" | |
# Rollbar access token | |
ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxx |
View grunt-replace.js
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
options: { | |
patterns: [ | |
{ | |
src: ['assets/js/**/*.js', 'assets/css/**/*.css',], | |
search: /@@([^@]+?)@@/g, | |
replace: function(matched, part, offset, string) { | |
if(summary[part]) { | |
return summary[part]; | |
} | |
else { |
View test.js
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
var foo = function(text, callback) { | |
if(text == "hello") { | |
callback("hello world"); | |
console.log("Someone said hello"); | |
} | |
callback("why don't you say hello?"); | |
console.log("nobody likes me :("); | |
} | |
foo("hello", function(result) { |
View node_debian_init.sh
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/sh | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
View multi-exec.sh
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 | |
user="${1}" | |
host="${2}" | |
like="${3}" | |
all_dbs="$(mysql -u $user -p -h "$host" -Bse 'SELECT SCHEMA_NAME from information_schema.SCHEMATA WHERE SCHEMA_NAME like "${like}"' 2> /dev/null)" | |
for db in $all_dbs | |
do | |
mysql -u $user -p -h "$host" $db -sN -e "SELECT * FROM centerdaten;" 2> /dev/null |
View what-changed.sh
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 | |
dir1="/tmp/dir1" | |
dir2="/tmp/dir2" | |
IFS=$'\n' | |
for file in $(grep -Ilsr -m 1 '.' "$dir1"); do diff -q --exclude="cache" "$file" "${file/${dir1}/${dir2}}" 2> /dev/null; done |
NewerOlder