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
APP BOILER | |
Entry Points | |
Time | |
check local storage (last || total visit(s)), | |
check server/appstorage (last || total visit(s)) | |
check TOD | |
check DOW (work/school) | |
check MOY (season general, available activities) |
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 toggleFullScreen() { | |
var doc = window.document; | |
var docEl = doc.documentElement; | |
var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen; | |
var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen; | |
// if(!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement) { | |
requestFullScreen.call(docEl); | |
// } |
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){ |
NewerOlder