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
# include <stdio.h> | |
# include <stdlib.h> | |
# include <time.h> | |
void color() { | |
printf("\033[38;5;%dm", 17 + 6 * (rand() % 35) + rand() % 4); | |
} | |
int main() { | |
int input; srand(time(NULL)); color(); |
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/sh | |
# Raspi FW update tool | |
sudo apt-get install git-core binutils ca-certificates | |
sudo wget http://raw.github.com/Hexxeh/rpi-update/master/rpi-update -O /usr/bin/rpi-update | |
sudo chmod +x /usr/bin/rpi-update | |
sudo rpi-update | |
# Clean-up | |
sudo apt-get purge git-core binutils ca-certificates | |
sudo rm -rf /usr/bin/rpi-update /root/.rpi-firmware | |
# Ta-da! |
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/sh | |
# Time zones | |
sudo dpkg-reconfigure tzdata | |
sudo apt-get update | |
yes | sudo apt-get upgrade | |
yes | sudo apt-get install console-data locales | |
# Locales | |
sudo dpkg-reconfigure locales | |
# Bloatware away! | |
yes | sudo apt-get purge x11-common midori lxde python3 python3-minimal |
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
/* | |
DOM(String Query[, DOM Node / Window Context]) | |
DOM(Wrappable1[, Wrappable2[, Wrappable3[, ... WrappableN]]]) -> DOM Object Wrapper | |
DOM.searchEngine([Function searchEngine]) -> Sets / Resets the search function | |
DOM.plugins = {}; | |
new DOM[.Prototype].Fragment([Wrapped Node(s) / Node[, Wrapped Node(s) / Node ...]]) | |
new DOM[.Prototype].Element(String Element1Name[, String Element2Name[, String ElementNName]]) |
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(NaN, Array, Math, Number, undefined) { | |
var funcPointer = { | |
log: Math.log, | |
pow: Math.pow, | |
rng: Math.random | |
}, | |
isNumber = Number.isNumber, | |
isFloat = function(n) { | |
return /\./.test(n); |
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.overload = function(f) { | |
if(!(f instanceof Function)) return; | |
var _$ = function() { | |
var $ = [arguments, , this, _$._overloads], | |
_ = function(type, index) { | |
if(type instanceof Array) return type.some(function(type) { | |
return _(type, index); | |
}); | |
if(!($[0][index] instanceof Object)) | |
$[0][index] = Object($[0][index]); |
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(global, isNaN, undefined) { | |
var arrLikeString = !!"1"[0], has, get; | |
if(!arrLikeString) { | |
has = function(arr, item, isStr) { | |
return isStr?item < arr.length: | |
item in arr; | |
}; | |
get = function(arr, item, isStr) { | |
return isStr?arr.charAt(item):arr[item]; |
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 Accessors = (function($, undefined) { | |
var ECMA5Support = | |
Object.getOwnPropertyDescriptor instanceof Function && | |
Object.defineProperty instanceof Function && (function() { | |
var o = {}, f = function() {return true}; | |
try { | |
Object.defineProperty(o, "o", {get: f}); | |
return o.o && Object.getOwnPropertyDescriptor(o, "o").get === f; | |
} catch(e) { | |
return false; |
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 Points(lat1, lon1, alt1, | |
lat2, lon2, alt2) { | |
alt1 = alt1 / 1000 || 0; | |
alt2 = alt2 / 1000 || 0; | |
var dLat = (lat2 - lat1).degToRad(), | |
dLon = (lon2 - lon1).degToRad(), | |
dAlt = alt2 - alt1; | |
lat1 = lat1.degToRad(); | |
lat2 = lat2.degToRad(); | |
lon1 = lon1.degToRad(); |
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 Object2() { | |
this.prototypes = arguments; | |
this.attributes = {}; | |
}; Object2.prototype.get = function(key) { | |
return this.attributes[key] || (function(array) { | |
for(var i = 0, l = array.length, result; !result && i < l; i++) | |
result = array[i].get(key); return result; | |
})(this.prototypes); | |
}; Object2.prototype.set = function(key, value) { | |
this.attributes[key] = value; |
OlderNewer