Skip to content

Instantly share code, notes, and snippets.

@jhsu
jhsu / vimrc.markdown
Last active December 10, 2015 21:59
netrw + nerdtree to navigate files in buffer rather than in a drawer.

Inspired by vimcast article

Open file browser in curent buffer

This makes it more clear which split a file will be opened in.

Use rbgrouleff/bclose.vim to close the buffer and not break splits.

@kamarcum
kamarcum / utf_8.rb
Created October 28, 2012 16:25
Generating non-UTF-8 strings in ruby for testing
# It's sort of difficult to make a non-UTF-8 string in
# ruby that contains characters that aren't in UTF-8.
# Here's how I did it.
# 0x89 isn't allowed in UTF-8
bad_chars = [0x89].pack("c*").force_encoding("ISO-8859-1")
@IlianIliev
IlianIliev / fabfile.py
Created May 28, 2012 11:04
Fabric script that eases the creation of new Django Project
"""
This fabric script automates the creation of a virtual environment and a Django
project. The result will be virtual environtment with the name of the project.
The folder namer where the project code will be placed is specified in
SOURCE_DIRECTORY_NAME, a static root folder will be created and settings.py
will be updated.
"""
try:
from fabric.api import env, run, local
from fabric.context_managers import lcd, prefix
@kylelemons
kylelemons / gotour-69.go
Created October 7, 2011 01:55
My solution to Go Tour #69 - Web Crawler
package main
import (
"os"
"fmt"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.