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 pad = (n, width, z) => { | |
z = z || '0' | |
n = n + '' | |
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + 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
app.configure('production', function() { | |
var oneYear = 31557600000; | |
app.use(express.static(__dirname + '/public', { maxAge: oneYear })); | |
app.use(express.errorHandler());}); |
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 LANG=es_ES.UTF-8 | |
export LANGUAGE=es_ES.UTF-8 | |
export LC_ALL=es_ES.UTF-8 | |
dpkg-reconfigure locales |
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
app.use((req, res, next) => { | |
var data = ""; | |
req.on('data', chunk => { data += chunk }) | |
req.on('end', () => { | |
req.rawBody = data | |
req.jsonBody = JSON.parse(data) | |
next() | |
}) | |
}) |
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
if (!String.prototype.repeat) { | |
String.prototype.repeat = function(count) { | |
'use strict'; | |
if (this == null) { | |
throw new TypeError('can\'t convert ' + this + ' to object'); | |
} | |
var str = '' + this; | |
count = +count; | |
if (count != count) { | |
count = 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
var script = document.createElement('script');script.src = "https://code.jquery.com/jquery-3.2.1.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(script); |
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 toJSON(node) { | |
node = node || this; | |
var obj = { | |
nodeType: node.nodeType | |
}; | |
if (node.tagName) { | |
obj.tagName = node.tagName.toLowerCase(); | |
} else | |
if (node.nodeName) { | |
obj.nodeName = node.nodeName; |
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
/* ANGULAR 1.5 CLIENT BASIC COMANDS | |
gen -h => help | |
gen new project_name => make new project | |
gen -c component_name => make new component | |
npm start => run development server | |
npm run build => build distribution bundle | |
*/ | |
/* COMPONENT HTML | |
<h1 id="ar"><span ng-click="homeController.funcio()">{{homeController.name}}</span> world! </h1> |
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
/* | |
<body ng-app="routerApp"> | |
<nav class="navbar navbar-inverse" role="navigation"> | |
<div class="navbar-header"> | |
<a class="navbar-brand" ui-sref="#">AngularUI Router</a> | |
</div> | |
<ul class="nav navbar-nav"> | |
<li><a ui-sref="home">Home</a></li> | |
<li><a ui-sref="proba">Proba</a></li> | |
</ul> |
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/env node | |
const sb = require('spellbook') | |
console.log('test') | |
console.log(sb.random(0,5)) |
OlderNewer