- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
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
/** | |
* A script to generate a bunch on empty dashboard and index-pattern SOs. | |
* Result of the script is written into bulk-create-api.json file. | |
* Created file can be imported into a Cloud instance with any network client. | |
* An example with curl: | |
POST https://{cloud_url}/s/{space-name}/api/saved_objects/_bulk_create?overwrite=true | |
Authorization: Basic {token} | |
Accept: application/json | |
Content-Type: application/json | |
kbn-xsrf: true |
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
const config = { | |
endpointUrl: process.URL | |
} |
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 (document.body && ['complete', 'loaded', 'interactive'].indexOf(document.readyState) > -1) { | |
run(); | |
} else { | |
document.addEventListener('DOMContentLoaded', run, false); | |
} | |
function run(){ | |
console.log('I ran'); | |
window.get()(); | |
} |
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
// "error-stack-parser": "2.0.1", | |
// "stacktrace-gps": "3.0.2" | |
// additional sources https://github.com/stacktracejs/stacktrace.js/blob/master/stacktrace.js#L102-L116 | |
import fs from 'fs'; | |
import path from 'path'; | |
import { SourceMapConsumer } from 'source-map'; | |
import StackTraceGPS from 'stacktrace-gps'; | |
import ErrorStackParser from 'error-stack-parser'; | |
import mapValues from 'lodash/mapValues'; |
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 getSources = function(name) { | |
var filename = name.substr(templateParams.htmlWebpackPlugin.files.publicPath.length); | |
return templateParams.compilation.assets[filename].source(); | |
} | |
templateParams.htmlWebpackPlugin.files.css.map(getSources) | |
templateParams.htmlWebpackPlugin.files.js.map(getSources) |
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 hello = 'hello'; | |
var world = 'world'; | |
var mark = '!'; | |
var options = { | |
silent: true | |
}; | |
function greet(options, first, second){ | |
if (options.silent){ |
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 | |
REL_PATH=$(dirname $0) | |
cd $REL_PATH | |
env=$1 | |
CONFIG=$(cat container-config/env-$env.sh | base64) | |
# delete the old config | |
sed -e "s/{{config_data}}/''/g" container-config/config-template.yaml | kubectl delete -f - |
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(fn, cb){ | |
var a = fn(cb); | |
var b; | |
setTimeout(function(){ | |
b = fn(cb); | |
}, 100); | |
} | |
function Man(name, age){ | |
this.name = name; |
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
exports.fastElements = function(obj) { | |
if (%HasFastSmiElements(obj)) { | |
console.log('Fast SMI elements'); | |
} | |
if (%HasFastSmiOrObjectElements(obj)) { | |
console.log('Fast SMI or Object elements'); | |
} | |
if (%HasFastObjectElements(obj)) { | |
console.log('Fast Object elements'); | |
} |
NewerOlder