val
for constant values (maybeconst
?)
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(context, attachPrototype) { | |
// obj: Object or scalar to clone. Accepts any value or lack thereof. Technically optional. | |
// deep: Whether to perform a deep clone. Defaults to false (shallow clone). Optional. | |
// deepFunctions: Whether to clone functions when deep cloning. Unless you are doing some fancy voodoo, | |
// this should remain at the default of false, as these often represent types. Don't | |
// mess with this unless you understand the consequences of cloning a type complete | |
// in-tact, which is almost never what you want to do. Optional. | |
// | |
// NOTE: This will fail to clone properties created using ECMA 5's Object.defineProperty function. Provided | |
// that defineProperty is used with adequate discretion, this should not become an issue. However, if |
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
// Will Absolute Centering work in this browser? | |
Modernizr.testStyles('#modernizr { height: 50px; width: 50px; margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; }', function(elem, rule) { | |
Modernizr.addTest('absolutecenter', Math.round(window.innerHeight / 2 - 25) === elem.offsetTop); | |
}); | |
// Does this browser support Display: Table variable height? | |
Modernizr.testStyles('#modernizr { display: table; height: 50px; width: 50px; margin: auto; position: absolute; top: 0; left: 0; bottom: 0; right: 0; }', function(elem, rule) { | |
Modernizr.addTest('absolutecentercontent', Math.round(window.innerHeight / 2 - 25) === elem.offsetTop); | |
}); |
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 replace(txt) { | |
txt = txt.replace(/witnesses/gi, "dudes I know"); | |
txt = txt.replace(/allegedly/gi, "kinda probably"); | |
txt = txt.replace(/new study/gi, "tumblr post"); | |
txt = txt.replace(/rebuild/gi, "avenge"); | |
txt = txt.replace(/space/gi, "spaaace"); | |
txt = txt.replace(/google glass/gi, "virtual boy"); | |
txt = txt.replace(/smartphone/gi, "pokédex"); | |
txt = txt.replace(/electric/gi, "atomic"); | |
txt = txt.replace(/senator/gi, "elf-lord"); |
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
// ==UserScript== | |
// @name FunNewsSubstitutions | |
// @namespace http://mauve.us.to | |
// @description This is a filter I made that makes reading news more fun, I got the idea from http://xkcd.com/1288/. Since it's a userscript it should be easily install-able in Chrome or Firefox | |
// @include * | |
// ==/UserScript== | |
// Wrapper to keep things in their own scope | |
(function(){ | |
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": "XKCD Text", | |
"version": "0.1", | |
"permissions": [ | |
"http://*/*" | |
], | |
"content_scripts": [ | |
{ | |
"matches": ["http://*/*"], | |
"js": ["xkcdfy.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
#!/usr/bin/ruby | |
# dependencies: | |
# gem install sinatra | |
# gem install mechanize | |
# | |
# to run: | |
# from command line type: ruby substitutions.rb & | |
# and in your browser, go to: localhost:4567/http://some.random.site.com/ |
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
html { | |
background-image: url(http://subtlepatterns.com/patterns/bo_play_pattern.png); | |
padding-top: 10px; | |
} | |
body { | |
padding-top: 15px; | |
padding-bottom: 20px; | |
} |
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
/** | |
* A hash table value value storage for quick seek in large lists of big objects/arrays/strings. | |
* It uses CRC32 algorithm to convert supplied values into integer hashes and produce more elegant solution escaping data redundancy and heavy memory loads but also leaning on native hash map implementation for seek speed and optimization. | |
* | |
* @author Nikola Stamatovic Stamat < stamat@ivartech.com > | |
* @copyright ivartech < http://ivartech.com > | |
* @version 1.0 | |
* @date 2013-07-02 | |
* @namespace ivar.data | |
*/ |