Skip to content

Instantly share code, notes, and snippets.

View subfuzion's full-sized avatar

Tony Pujals subfuzion

View GitHub Profile
@subfuzion
subfuzion / github-wiki-how-to.md
Last active March 13, 2025 09:40
GitHub Wiki How-To

How do I clone a GitHub wiki?

Any GitHub wiki can be cloned by appending wiki.git to the repo url, so the clone url for the repo https://myorg/myrepo/ is: [email protected]:myorg/myrepo.wiki.git (for ssh) or https://github.com/my/myrepo.wiki.git (for https).

You make edits, and commit and push your changes, like any normal repo. This wiki repo is distinct from any clone of the project repo (the repo without wiki.get appended).

How do I add images to a wiki page?

@subfuzion
subfuzion / container-info.md
Last active October 11, 2020 18:47
Get Docker container IP and Port

Given a docker machine (started with docker-machine) and a docker-compose.yml file with a service (ex: web) that exposes a port (ex: 3000), get the address for a running container, ex:

$ addr web 3000
192.168.99.100:32768

If not running from directory containing docker-compose.yml, or if you want to use an alternative .yml file, specify the file pathname with the 3rd parameter, ex:

$ addr web 3000 path/to/common.yml
192.168.99.100:32768
@subfuzion
subfuzion / config.yml
Last active March 17, 2016 00:47
Config
version: "2"
services:
voting-app:
image: docker/example-voting-app-voting-app
ports:
- "80:80"
result-app:
image: docker/example-voting-app-result-app
ports:
@subfuzion
subfuzion / readfile1.js
Created March 20, 2016 00:22
promisified fs.readFile
'use strict';
var promisify = require('promisify-lite');
var fs = require('fs');
fs = promisify(fs);
let f = require('path').join(__dirname, './file.txt');
fs.readFileAsync(f, 'utf8')
@subfuzion
subfuzion / .tmux.conf
Last active August 22, 2023 15:33
My .tmux.conf for tmux 2.1 (with fixes for mouse breakage)
# Inspirations:
# http://mutelight.org/practical-tmux
# http://zanshin.net/2013/09/05/my-tmux-configuration/
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# http://stackoverflow.com/questions/9628435/tmux-status-bar-configuration
# https://github.com/Lokaltog/powerline
# https://github.com/remiprev/teamocil
# http://superuser.com/questions/74492/whats-the-best-prefix-escape-sequence-for-screen-or-tmux
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
#
@subfuzion
subfuzion / .bashrc
Created March 25, 2016 15:18
Docker Machine & Compose: Get IP and PORT
function addr {
service=$1
containerport=$2
file=${3:-"docker-compose.yml"}
echo $(docker-machine ip $(docker-machine active)):$(docker-compose -f $file port $service $containerport | cut -d ':' -f 2
}
@subfuzion
subfuzion / ubuntu-setup-checklist.md
Last active May 4, 2023 13:03
Ubuntu set up checklist
@subfuzion
subfuzion / addr.sh
Last active May 5, 2016 06:45
Get container address
addr() {
service=$1
containerport=$2
file=${3:-"docker-compose.yml"}
echo $(docker-machine ip $(docker-machine active)):$(docker-compose -f $file port $service $containerport | cut -d ':' -f 2)
}
@subfuzion
subfuzion / install-go.md
Last active June 11, 2023 17:44
Installing go

Download

$ wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz

Unarchive it

$ VERSION=1.6.2
$ OS=linux
$ ARCH=amd64
@subfuzion
subfuzion / tryerror.js
Created May 17, 2016 17:10
Await with error
/* eslint-disable no-constant-condition, no-console, babel/no-await-in-loop */
import 'babel-polyfill'
import 'source-map-support/register'
function echo(i, badModulus = 3) {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (i % badModulus === 0) {
return reject(new Error('boom'))
}