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
//requires jQuery | |
$(window).scroll(function(){ | |
var threshold = 200; // number of pixels before bottom of page that you want to start fading | |
var op = (($(document).height() - $(window).height()) - $(window).scrollTop()) / threshold; | |
if( op <= 0 ){ | |
$("#thing-to-hide").hide(); | |
} else { | |
$("#thing-to-hide").show(); | |
} | |
$("#thing-to-hide").css("opacity", op ); |
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
// http://www.2ality.com/2013/09/javascript-unicode.html | |
function toUTF16(codePoint) { | |
var TEN_BITS = parseInt('1111111111', 2); | |
function u(codeUnit) { | |
return '\\u'+codeUnit.toString(16).toUpperCase(); | |
} | |
if (codePoint <= 0xFFFF) { | |
return u(codePoint); | |
} |
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 rotateArrayRight( arr ){ | |
// rotates a 2D array 90 degrees to the right (clockwise) | |
var newarr = []; | |
for( var x = 0; x < arr[0].length; x++ ){ | |
newarr[x] = []; | |
for( var y = arr.length - 1; y >= 0; y-- ){ | |
newarr[x].push( arr[y][x] ); | |
} |
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
" Find all closing tags, add a linebreak after each grouping. | |
" This is useful when your whole HTML file has had the whitespace removed by a rogue WYSIWYG editor. | |
" NOTE: I don't think this .vim file would actually work in vim. I just gave it that extension for Gist's sake. | |
:%s@\(<\/\w\{1,10\}>\)\+@&\r@gc | |
" command explanation below | |
" : begin command | |
" % use all lines in file | |
" s search and replace |
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
console.oldwarn = console.warn; | |
console.warn = (...args) => { | |
alert([...args].join(' ')); | |
console.oldwarn.call(null,...args); | |
} | |
console.olderror = console.error; | |
console.error = (...args) => { | |
alert([...args].join(' ')); | |
console.olderror.call(null,...args); | |
} |
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
#trello-root { background: #000!important; } | |
.list {background-color: #333; } | |
.list textarea { color: #999; } | |
.list .list-card { background-color: #444; } | |
.list .list-card span {color: #000; } | |
.list .list-card .card-label { opacity: 0.25; } | |
.window { background-color: #333; } | |
.window span, .window h3, .window textarea, .window a { color: #999; } | |
.window .action-comment { background-color: #444; } |
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 lorem(){ | |
# Copy lorem ipsum to your clipboard in OS X | |
# usage: | |
# $ lorem <int> <htmlflag> | |
# where <int> is how many paragraphs of lorem ipsum you want, each separated by 2 newlines | |
# and <htmlflag> is anything, indicating you want each paragraph surrounded by <p></p>. Omit if you don't want this. |
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
<head> | |
... | |
<link href="https://fonts.googleapis.com/css?family=VT323" rel="stylesheet"> | |
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script> | |
<script> | |
WebFont.load( { | |
custom: { | |
families: [ 'VT323' ] |
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
// https://stackoverflow.com/a/14570614/448640 | |
var observeDOM = (function(){ | |
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver, | |
eventListenerSupported = window.addEventListener; | |
return function(obj, callback){ | |
if( MutationObserver ){ | |
// define a new observer | |
var obs = new MutationObserver(function(mutations, observer){ |
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
REM These commands allow you to dump a mysql database or import a database that is too large to be uploaded via PHPmyAdmin. | |
REM If importing, you should put your .sql file in your mysql bin dir ( for wamp: C:\wamp\bin\mysql\mysql15.5.20\bin\ ) | |
REM If exporting, the mysql bin dir is where the exported file will show up. | |
REM export a mysql database | |
REM wamp's username is root, does not have a password | |
mysqldump -u username -p password(optional) databasename > databasename.sql | |
REM import a mysql database | |
mysql -u username -ppassword databasename < databasename.sql |
NewerOlder