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
// formCheck - global variable token from page | |
// Enter in prompt articles url with new line delemiter | |
var _add = function (url){ | |
$.ajax({ | |
url: 'http://getpocket.com/a/x/itemAction.php' | |
,data:{ | |
action: 'add' | |
,formCheck: formCheck | |
, url: url | |
} |
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
class HomeController < ApplicationController | |
def contacts | |
UserMailer.notify_email( params[:text]).deliver | |
end | |
end |
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
String.prototype.format = function() { | |
var i = -1, args = arguments; | |
return this.replace(/#\{(.*?)\}/g, function(one, two) { | |
return (typeof args[0] == 'object')?args[0][two]:args[++i]; | |
}); | |
} | |
var thing = 'world!'; |
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 bind_logging = (function(strategies, loggers) { | |
var log_always = '#bind_logging' == document.location.hash; | |
var canWeLogThis = function(eventflow) { | |
return _.every(['on', 'off', 'trigger'], function(n){ return eventflow && _.isFunction(eventflow[n]) }); | |
}, | |
canWeLogHere = function() { | |
return _.every(['groupCollapsed', 'groupEnd', 'log', 'trace'], function(n){ return console && _.isFunction(console[n]) }); | |
}, | |
getLogger = function(ctx, args) { | |
for(var i = 0; i < strategies.length; i++) { |
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
[].forEach.call(document.querySelectorAll('form'), function (input) { | |
var table = []; | |
console.group('HTMLForm "' + input.name + '": ' + input.action); | |
console.log('Element: ', input, '\nName: ' + | |
input.name + '\nMethod: ' + input.method.toUpperCase() + | |
'\nAction: ' + input.action || 'null'); | |
['input', 'textarea', 'select'].forEach(function (control) { | |
[].forEach.call(input.querySelectorAll(control), function (node) { |
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 | |
hosts=( "$@" ) | |
total_hosts=${#hosts[@]} | |
while : | |
do | |
l_hosts=( ${hosts[@]} ) | |
for i in ${!l_hosts[@]} | |
do |
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
# Usage | |
# $ source /dev/stdin < <(curl url.this.bashrc) | |
PS1=$'\[\033]0;\u:${PWD##*/}\007\]' | |
PS1+=$'\[\e[0;32m\]\u\[\e[m\]\[\e[0;32m\]@\H\[\e[m\] \[\e[0;30;42m\] [home +\j] \[\e[m\]' | |
PS1+=$'\n\[\e[0;34m\]\w\[\e[m\] \[\e[0;32m\]\xe2\x98\x85\[\e[m\] \[\e[0;37m\] ' |
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
#!/usr/bin/bash | |
mysql -u user -e 'DROP DATABASE IF EXISTS db_dev; CREATE DATABASE db_dev;' | |
ssh hlts -C -o CompressionLevel=9 'mysqldump -udeploy --password=password \ | |
--skip-lock-tables \ | |
crm | gzip -9 -c' | gunzip | mysql -u root db_dev |
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
ssh_mount_dir='servers/' | |
export TERM=xterm-256color | |
export EDITOR="vim" | |
export CDPATH=:..:~/$ssh_mount_dir:~ | |
if [[ $- != *i* ]] ; then | |
return | |
fi |
OlderNewer