Skip to content

Instantly share code, notes, and snippets.

@tuxracer
tuxracer / index.coffee
Last active December 21, 2015 16:19
yeoman generator index file in coffeescript. Compare to https://gist.github.com/tuxracer/6336244 You can also use https://github.com/tuxracer/generator-generatorcs to get this
# Generated by https://github.com/tuxracer/generator-generatorcs
path = require 'path'
yeoman = require 'yeoman-generator'
module.exports = class ChaplinGenerator extends yeoman.generators.Base
constructor: (args, options, config) ->
yeoman.generators.Base.apply this, arguments
@on 'end', ->
@installDependencies skipInstall: options['skip-install']
@shawnbot
shawnbot / Makefile
Created August 7, 2013 01:36
Read environment variables from your .env in make tasks.
test:
source .env && echo "my secret key is: $$SECRET_KEY"
@willurd
willurd / web-servers.md
Last active April 23, 2024 23:07
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@johanneswuerbach
johanneswuerbach / .travis.yml
Last active April 14, 2023 20:31
Deploy an iOS app to testflight using Travis CI
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@mouseroot
mouseroot / ip_routing_win7.txt
Created April 30, 2013 16:41
Enable IP Routing in Windows 7
1. Open regedit
2. Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\"
3. Change IPEnableRouter to 1
4. Run services->Routing and Remote->start
(reboot may be nessesary)
@phette23
phette23 / current-dir-in-iterm-tab-title.sh
Last active January 4, 2024 10:20
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@misterbrownlee
misterbrownlee / jenkins-notes.md
Created September 12, 2012 18:10
Jenkins setup

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@border
border / mgoExample.go
Created August 27, 2012 15:33
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@czj
czj / gist:1263872
Created October 5, 2011 07:39
Script to encode with HandbrakeCLI (x264) 720p, high image quality, low file size
#!/usr/bin/env ruby
# encoding: utf-8
# x264 presets guide : https://forum.handbrake.fr/viewtopic.php?f=6&t=19426
X264 = "b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all"
FORMAT = "--optimize --format mp4"
QUALITY = "--ab 64 --mixdown mono --quality 23 -e x264 -x '#{X264}'"
SIZE = "--width 1280 --height 720"
ARGV.each do |param|
@kch
kch / yaml-to-plist.rb
Created August 4, 2010 14:50
Writes ruby object structures to plists. When called directly, takes a YAML file.
#!/usr/bin/env ruby
# encoding: UTF-8
require 'yaml'
require 'rexml/document'
class PlistWriter
PLIST_STUB_DOC = %q[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"></plist>]