Skip to content

Instantly share code, notes, and snippets.

View subfuzion's full-sized avatar

Tony Pujals subfuzion

View GitHub Profile
@subfuzion
subfuzion / .vimrc
Created February 4, 2015 18:15
vimrc file
syntax on
set nowrap
set nonumber
set ruler
set shiftwidth=2
set showmode
set ai sw=2
set vb t_vb=
" http://vim.wikia.com/wiki/Easier_buffer_switching
Hello {{ name }}
{
"name": "World"
}
---
data: https://gist.githubusercontent.com/subfuzion/c77cd766397844f1fb28/raw/7f9c526ae145e6fb47fea08e957dcb775f92bf46/data.json
template: https://gist.githubusercontent.com/subfuzion/006e0d2550881956c1c9/raw/d7732488b5a9bb63830f258c9571d3f849ba494b/hello.nunjucks
{
"data": "https://gist.githubusercontent.com/subfuzion/c77cd766397844f1fb28/raw/7f9c526ae145e6fb47fea08e957dcb775f92bf46/data.json",
"template": "https://gist.githubusercontent.com/subfuzion/006e0d2550881956c1c9/raw/d7732488b5a9bb63830f258c9571d3f849ba494b/hello.nunjucks"
}
@subfuzion
subfuzion / docker-compose.yml
Created March 29, 2015 09:20
Sample docker-compose.yml
web:
build: .
links:
- mongo
ports:
- "27017:27017"
mongo:
image: mongo
@subfuzion
subfuzion / nvm-bash-config.md
Last active August 29, 2015 14:18
I use nvm to switch between io.js and node. These is my .bashrc configuration.

nvm works great for switching between versions of io.js and node. Get it here:

https://github.com/creationix/nvm

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
[ -r $NVM_DIR/bash_completion ] && . $NVM_DIR/bash_completion
export NVM_SYMLINK_CURRENT=true
@subfuzion
subfuzion / .bashrc
Created June 18, 2015 15:55
Get dynamically assigned ports in Docker
function port {
if [[ $2 ]]; then
FORMAT='{{(index (index .NetworkSettings.Ports "'$2'/tcp") 0).HostPort}}'
elif [[ $1 ]]; then
FORMAT='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}'
else
echo "error: missing container-id"
echo "usage: port <container-id> [port]"
return 1
fi
@subfuzion
subfuzion / simple-schema-example.md
Created August 4, 2015 22:39
Simple schema example from the JSON Schema website

Simple schema example from the JSON Schema website example page:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Product",
    "description": "A product from Acme's catalog",

    "type": "object",
 
@subfuzion
subfuzion / json-schema-example.md
Created August 5, 2015 00:33
JSON Schema Example
{
  "definitions": {
    "Pet": {
      "type": "object",
      "required": [
        "name",
        "photoUrls"
      ],
      "properties": {