Skip to content

Instantly share code, notes, and snippets.

@dweldon
dweldon / install-pgadmin4.sh
Created August 4, 2022 05:12
Install pgAdmin 4 on Ubuntu without using apt-key (22.04)
View install-pgadmin4.sh
#!/bin/sh
# https://askubuntu.com/questions/1286545/
# https://www.pgadmin.org/download/pgadmin-4-apt/
gpg_file="pgadmin4.gpg"
wget https://www.pgadmin.org/static/packages_pgadmin_org.pub
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import packages_pgadmin_org.pub
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output "${gpg_file}"
@dweldon
dweldon / install-mongo.sh
Created August 3, 2022 21:11
Install mongodb on ubuntu without using apt-key
View install-mongo.sh
#!/bin/sh
# https://askubuntu.com/questions/1286545/
# https://www.mongodb.com/docs/v4.4/tutorial/install-mongodb-on-ubuntu/
version='4.2'
gpg_file="mongodb-${version}.gpg"
wget "https://www.mongodb.org/static/pgp/server-${version}.asc"
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import "server-${version}.asc"
@dweldon
dweldon / install-docker.sh
Last active April 8, 2022 11:18
Install docker CE on Linux Mint 18.3
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/
@dweldon
dweldon / local-user.md
Last active March 2, 2023 18:51
Add a local pg user who can login without a password
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
@dweldon
dweldon / play-webpack.md
Created February 12, 2017 15:02
Add vue-play to a vue-cli webpack project
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
@dweldon
dweldon / filepicker.js
Created October 1, 2014 17:50
meteor-filepicker
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',
@dweldon
dweldon / leaderboard.js
Last active August 29, 2015 14:04
Leaderboard with ip-based vote restriction.
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"));
@dweldon
dweldon / meteor-nginx
Last active November 26, 2021 17:06
This is an example of how to configure nginx to serve a meteor app.
View meteor-nginx
server {
listen [::]:80;
listen 80;
server_name app.example.com;
return 301 https://$server_name$request_uri;
}
server {
@dweldon
dweldon / Cakefile
Last active December 11, 2015 18:49
This is a Cakefile for automatically compiling jade templates to html files in an arbitrarily deep directory tree. It was intended for use with meteor, however you can use it with any framework by changing the start task and the DIR. NOTE: this requires that chokidar and jade be installed via npm. NOTE: this assumes that the only html files unde…
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