Discover gists
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
# more to come | |
#!/bin/bash | |
#!/bin/bash | |
function reba(){ | |
#first arg is rebase branch | |
count=1 | |
for branch in "$@" | |
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
arguments.callee.caller.toString() |
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
// add syntax hilighting | |
d = document.createElement('div') | |
d.className = "viewsorcery"; | |
document.getElementsByTagName('body')[0].appendChild(d) | |
vs = document.querySelector('.viewsorcery') | |
vs.style = "position:absolute; top: 0"; | |
(function() { | |
var a = [], | |
c = 0, |
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
[ | |
{ | |
"name": "Afghanistan", | |
"dial_code": "+93", | |
"code": "AF" | |
}, | |
{ | |
"name": "Aland Islands", | |
"dial_code": "+358", | |
"code": "AX" |
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
//needs to account for encoded blanks other than '' | |
var articleBodyClass = "#article-body"; | |
arr = $(articleBodyClass).text().split(" ") | |
arr.forEach(function(e,i,a){if(e==""||e==" "){a.splice(i,1)}}) | |
console.log(arr) |
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
f = function(needle,haystack,collect){ | |
collection = []; | |
haystack.filter(function(item){ | |
if(typeof item === "string" && item.match(needle)!== null) | |
collect += item; | |
}) | |
return collect; | |
} |
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
f = function(selector){ | |
var collect = [], | |
// exPattern = /(^"[Mr|Mrs|Ms|Dr])\.(?![net|com|org|us|info])/; | |
exPattern = /\.(?![net|com|org|us|info])/; | |
[].forEach.call(document.querySelectorAll(selector),(e,i,a)=>{collect.push(e.textContent.split(exPattern))}) | |
return collect; | |
} | |
// make titles work |
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 gulp = require('gulp'); | |
var server = require('gulp-server-livereload'); | |
gulp.task('webserver', function() { | |
gulp.src('./') | |
.pipe(server({ | |
livereload: { | |
enable: true, | |
port: [35728], | |
filter: function(fp,cb){ |
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
// checks for capitalization and all caps | |
(function(){ | |
UCity = function(toke = "Buttocks",verbose = false){ | |
ptrn = toke.split("").map(function(el, i, a){ | |
return el.toUpperCase() === el ? 1 : 0 | |
}), | |
capdness = ptrn.reduce(function(a,b){return a + b})/ptrn.length, | |
allcap = capdness === 1 ? true : false, | |
capd = capdness == 1/toke.length && ptrn[0] == 1, |
NewerOlder