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 bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] | |
Script description here. |
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
// https://twitter.com/lukejacksonn/status/928244319760220160 | |
module.exports = { | |
clone: x => [...x], | |
push: y => x => [...x, y], | |
pop: x => x.slice(0, -1), | |
unshift: y => x => [y, ...x], | |
shift: x => x.slice(1), | |
sort: f => x => [...x].sort(f), | |
delete: i => x => [...x.slice(0, i), ...x.slice(i + 1)], |
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
cd /tmp && \ | |
npm install npm && \ | |
rm -rf /usr/local/lib/node_modules && \ | |
mv /tmp/node_modules /usr/local/lib/ && \ | |
cd && \ | |
npm install npm -g # update bin path for npx |
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 { MongoClient } = require('mongodb') | |
const MongoSeries = require('./mongo-run-series') | |
const { host } = process.env // mongodb://localhost:27017/database | |
const task = (doc, done) => { | |
// do something async with the mongodb document | |
done(null, {}) | |
} |
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
import React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<div className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> |
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
# ./sites-enabled/config | |
server { | |
listen 8080; | |
server_name helloxervo-96020.app.xervo.io; | |
root /mnt/app/build; | |
index index.html index.htm; | |
# single page app routing | |
location /.+\..+ { |
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
/** | |
* populator | |
* | |
* connects to a db and randomly populates it with data | |
*/ | |
const MONGO_URL = 'mongodb://user:[email protected]:27017/db_name' | |
const mongoose = require('mongoose') | |
const random = require('mongoose-simple-random') |
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 bash | |
meteor create --example leaderboard | |
modulus project create leaderboard -r node.js -s 512 | |
modulus env set ROOT_URL $(modulus project list | grep leaderboard | awk '{print $4}') -p leaderboard | |
modulus addons add mongo:base -p leaderboard | |
modulus deploy -p leaderboard |
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 os = require('os') | |
var cliopts = require('cliclopts') | |
var parseArgs = require('minimist') | |
var rc = require('rc') | |
var pkg = require('../package') | |
var opts = require('./options') | |
var clopts = cliopts(opts.default) |
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 State = require('ampersand-state'); | |
var A = State.extend({ | |
props: { n: 'number' }, | |
parse: function (attrs) { | |
attrs.n = parseInt(attrs.n, 10); | |
return attrs; | |
} | |
}); |
NewerOlder