Instantly share code, notes, and snippets.

View install-docker.sh
#!/usr/bin/env bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update
sudo apt-get install docker-ce
# https://docs.docker.com/compose/install/
View local-user.md

Install pg

sudo apt-get install postgresql postgresql-contrib

Login as postgres and create the new user (dave in this example)

sudo -i -u postgres
createuser dave
psql
View play-webpack.md

Introduction

Here are the steps I used to add vue-play to my vue-cli webpack project. These instructions assume a directory structure like this:

.
├── build
└── src
    ├── components
View filepicker.js
var retry = new Retry({
baseTimeout: 100,
maxTimeout: 2000
});
var retryCount = 0;
var load = function() {
$.ajax({
url: '//api.filepicker.io/v1/filepicker.js',
View leaderboard.js
Players = new Meteor.Collection("players");
IPs = new Meteor.Collection('ips');
if (Meteor.isClient) {
Template.leaderboard.players = function () {
return Players.find({}, {sort: {score: -1, name: 1}});
};
Template.leaderboard.selected_name = function () {
var player = Players.findOne(Session.get("selected_player"));
View meteor-nginx
server {
listen [::]:80;
listen 80;
server_name app.example.com;
return 301 https://$server_name$request_uri;
}
server {
View Cakefile
fs = require 'fs'
path = require 'path'
chokidar = require 'chokidar'
{spawn} = require 'child_process'
DIR = path.join __dirname, 'client'
isType = (file, type) ->
path.extname(file) is '.' + type