Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile
.parallax-inner .fusion-column-wrapper {
background-color: rgba(255,255,255,0.1);
text-shadow: 1px 1px 1px #666;
}
{
"etcd": {
"enabled": true
},
"nginx": {
"enabled": true
},
"mongodb": {
"enabled": true
},
<link type='text/css' rel='stylesheet' href='https://npmcdn.com/[email protected]/bundles/ionic.css'>
<script src='./show-frame-section.js'></script>
<iframe name='terms-frame' onload="showFrameSection( 'section' )" src='./terms.html' height='100%' width='100%' frameborder='0'></iframe>
{
"status": 0,
"body": {
"updatetime": 1249409679,
"timezone": "Europe/Paris",
"measuregrps": [
{
"grpid": 2909,
"attrib": 0,
"date": 1222930968,
@easierbycode
easierbycode / config.js
Created July 7, 2016 20:21
HTTP polling in Angular 2
System.config({
//use typescript for compilation
transpiler: 'typescript',
//typescript compiler options
typescriptOptions: {
emitDecoratorMetadata: true
},
//map tells the System loader where to look for things
map: {
app: './src'
@easierbycode
easierbycode / math.trunc.js
Created April 29, 2016 20:54
truncates the decimal part of a number
let num = 29.9;
console.log( Math.trunc( num ) );
@easierbycode
easierbycode / string.repeat.js
Created April 29, 2016 20:45
shows using string repeat w/ an astral plane character (a wave emoji)
let wave = '\u{1f30a}';
console.log( wave.repeat(10) );
// 🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊
let title = 'Santa Claus';
console.log( title.startsWith( 'Santa' ) );
// true
console.log( title.endsWith( 'Claus' ) );
// true
console.log( title.includes('clau') );
// false
@easierbycode
easierbycode / object.is.js
Created April 29, 2016 20:30
can be used to replace '==='. fixes some ES5 issues.
let notNum = NaN;
console.log( notNum === notNum );
// false
console.log( Object.is(notNum, notNum) )
// true
let amt = 0, total = -0;
console.log( amt === total )
let a = {a:1}, b = {b:2};
let target = {};
// skips non-enumerable properties
Object.defineProperty(b, 'c', {
value: 3,
enumerable: false
});