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
# use UTF8 | |
set -g utf8 | |
set-window-option -g utf8 on | |
# make tmux display things in 256 colors | |
#set -g default-terminal "xterm-256color" | |
# set scrollback history to 10000 (10k) | |
set -g history-limit 10000 |
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
node "craft-1.yoursite.net" { | |
$craft_pkgs = ['java-1.8.0-openjdk', 'java-1.8.0-openjdk-devel'] | |
$craft_root = '/opt/craft' | |
$craft_user = 'craft' | |
$craft_jar = "${craft_root}/minecraft.jar" | |
$craft_props = ' | |
allow-flight=true | |
allow-nether=true | |
difficulty=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
validateRegister(req.body).then(function(){ | |
return db.createUser(req.body.name, req.body.email, req.body.password); | |
}).then(function(newUser){ | |
console.log(2); | |
res.send({state: 'success', name: newUser.name}); | |
}).catch(function(err){ | |
res.send(500); | |
}); |
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 getRandomIntInclusive(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
function swap(items, firstIndex, secondIndex, transact){ | |
var temp = items[firstIndex]; | |
items[firstIndex] = items[secondIndex]; | |
items[secondIndex] = temp; | |
initialState.swapLeft = firstIndex; |
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
// Example interface and implementation | |
class Filesystem { | |
read(filename) { | |
throw new Error('Not implemented!'); | |
} | |
write(filename, content) { | |
throw new Error('Not implemented!'); | |
} | |
} |
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
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47 | |
$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39 |
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 withinRadius(v, r) { | |
return v.l < r; | |
} | |
function getDistance(playerA, playerB) { | |
const x = playerA.position.x - playerB.position.x; | |
const y = playerA.position.y - playerB.position.y; | |
const l = Math.sqrt((x * x) + (y * y)); | |
return {x, y, l}; | |
} |
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
String | |
= t:Token* { return t; } | |
Token | |
= v:Var { return v; } | |
/ v:Part { return v; } | |
Var | |
= T_START T_OPEN n:Name T_CLOSE { return {type: "var", name: 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
export default class Color { | |
/** | |
* Default constructor, taking each component as an argument: new Color(128, 0, 255) | |
* The opacity (alpha, a) is optional and defaults to 1.0 (100%). | |
*/ | |
constructor(r, g, b, a = 1.0) { | |
this._r = r; | |
this._g = g; | |
this._b = b; | |
this._a = a; |
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/bash | |
yum install -y epel-release | |
yum install -y git |