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
#define KRED "\x1B[31m" | |
#define KGRN "\x1B[32m" | |
#define KYEL "\x1B[33m" | |
#define KBLU "\x1B[34m" | |
#define KMAG "\x1B[35m" | |
#define KCYN "\x1B[36m" | |
#define KWHT "\x1B[37m" |
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
apt-get install apache2 php5 libapache2-mod-php5 curl php5-curl git emacs lm-sensors build-essential ruby xchat gparted python2.7 chromium-browser filezilla vlc terminator quiterss bleachbit unity-tweak-tool p7zip-full | |
npm install -g less grunt grunt-cli bower express less request |
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
int led = 12; | |
void setup() { | |
// initialize the digital pin as an output. | |
pinMode(led, OUTPUT); | |
} | |
// the loop routine runs over and over again forever: | |
void loop() { | |
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 binarytodecimal(binary) { | |
var decimal = 0; | |
for(var i = 0; i < binary.length; i++) { | |
if(binary.charAt(binary.length - i -1) == "1") { | |
decimal += Math.pow(2, i); | |
} | |
} | |
return decimal; |
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
int pwmPin = 9; // output pin supporting PWM | |
int inPin = 3; // voltage connected to analog pin 3, e.g. a potentiometer | |
int val = 0; // variable to store the read value | |
float volt = 0; // variable to hold the voltage read | |
float analogToVolt(int val) { | |
return (5.0 * val) / 1023; | |
} | |
int voltToPWM(float volt) { |
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> | |
int main() { | |
while(1 > 0) { | |
int *number = malloc(sizeof(int)); | |
} | |
return 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
/* montyanderson's gulp template */ | |
/* https://gist.github.com/montyanderson/5b71df07dbc9fc118837 */ | |
var gulp = require("gulp"), | |
less = require("gulp-less"), | |
streamify = require("gulp-streamify"), | |
uglify = require("gulp-uglify"), | |
rename = require("gulp-rename"), | |
minify = require("gulp-minify-css"), | |
source = require("vinyl-source-stream"), |
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
{ | |
"buildings":[ | |
{ | |
"id":"Youth Center", | |
"votes":3, | |
"approved":true | |
}, | |
{ | |
"id":"Meditation Centre", | |
"votes":2, |
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 rtp(ratios) { | |
var total = 0; | |
ratios.forEach(function(ratio) { | |
total += ratio; | |
}); | |
var percentages = []; | |
ratios.forEach(function(ratio) { |
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
for D in ~/bin/*; do | |
if [ -d "${D}" ]; then | |
export PATH=$PATH:${D} | |
if [ -d "${D}/bin" ]; then | |
export PATH=$PATH:${D}/bin | |
fi | |
if [ -d "${D}/src" ]; then | |
export PATH=$PATH:${D}/src |