Skip to content

Instantly share code, notes, and snippets.

@kavu
kavu / example.go
Created September 28, 2013 10:01
Minimal Golang + Cocoa application using CGO. Build with `CC=clang go build`
package main
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Cocoa/Cocoa.h>
int
StartApp(void) {
[NSAutoreleasePool new];
FROM ubuntu:12.04
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-6-jdk curl git-core build-essential bzr
RUN mkdir -p /tmp/downloads
# install go
RUN curl -sf -o /tmp/downloads/go1.1.1.linux-amd64.tar.gz -L https://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz
RUN mkdir -p /opt && cd /opt && tar xfz /tmp/downloads/go1.1.1.linux-amd64.tar.gz
# install jenkins
RUN curl -sf -o /opt/jenkins-1.523.war -L http://mirrors.jenkins-ci.org/war/1.523/jenkins.war
@fujin
fujin / gist:6094233
Last active December 20, 2015 07:38
thoughtworks go-server / go-agent powered with @dot_cloud Docker
ubuntu@continubus:~/dockerfiles/go-agent$ docker ps
ID IMAGE COMMAND CREATED STATUS PORTS
d89f44c4df5b fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute
a132f54a0442 fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute
da8b513fbb2a fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute
c100df11f9d7 fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute
929adf4cbc3b fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute
79720ed86e0b fujin/go-agent:latest /bin/sh -c /start.sh About a minute ago Up About a minute
ca9403fe93e2 fujin/go-agent:latest /b
@evanphx
evanphx / bundle-update-lockfile.rb
Last active August 8, 2016 11:44
Need to update a Gemfile.lock but don't want to install the gems? No problem! Run this in the same directory as your Gemfile!
#!/usr/bin/env ruby
require 'bundler'
gems = ARGV
if gems.empty?
puts "Updating all gems"
Bundler.definition(true)
@mislav
mislav / OpenSSL fix.md
Last active June 8, 2023 07:48
Fix OpenSSL certificate errors on Ruby 2.0

The reason why you might get certificate errors in Ruby 2.0 when talking HTTPS is because there isn't a default certificate bundle that OpenSSL (which was used when building Ruby) trusts.

Update: this problem is solved in edge versions of rbenv and RVM.

$ ruby -rnet/https -e "Net::HTTP.get URI('https://github.com')"
net/http.rb:917:in `connect': SSL_connect returned=1 errno=0 state=SSLv3
  read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)

You can work around the issue by installing a certificate bundle that you trust. I trust Mozilla and curl.

@bradediger
bradediger / carbon.rb
Created December 12, 2012 19:20
Homebrew formulae for graphite (carbon / whisper)
require 'formula'
class Carbon < Formula
homepage 'http://graphite.wikidot.com/'
url 'http://pypi.python.org/packages/source/c/carbon/carbon-0.9.10.tar.gz'
md5 '1d85d91fe220ec69c0db3037359b691a'
depends_on 'python'
depends_on 'twisted' => :python
depends_on 'whisper'
@subelsky
subelsky / puma_rails_heroku.rb
Created October 31, 2012 13:51
Setting up Puma and Rails on Heroku
# Gemfile
gem "puma"
# Procfile
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb
# add to config block config/environments/production.rb
config.threadsafe!
# get rid of NewRelic after_fork code, if you were doing this:
@abeluck
abeluck / gpg-offline-master.md
Last active October 22, 2023 02:59 — forked from KenMacD/cmd.md
GPG Offline Master Key w/ smartcard
@loopj
loopj / passenger-nginx-spdy.sh
Created August 5, 2012 20:21
Install passenger and nginx with SPDY support
#!/bin/sh
NGINX_VERSION=1.3.8
TMP_PATH=/tmp
# Fetch and extract Nginx
cd $TMP_PATH
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz
tar xvfz nginx-$NGINX_VERSION.tar.gz
cd nginx-$NGINX_VERSION
@rakhmad
rakhmad / clojure.md
Created April 17, 2012 15:55
Setting Up Clojure on OS X

Setting Up Clojure on OS X

I spent a lot of time trying to find a pretty optimal (for me) setup for Clojure… at the same time I was trying to dive in and learn it. This is never optimal; you shouldn't be fighting the environment while trying to learn something.

I feel like I went through a lot of pain searching Google, StackOverflow, blogs, and other sites for random tidbits of information and instructions.

This is a comprehensive "what I learned and what I ended up doing" that will hopefully be of use to others and act as a journal for myself if I ever have to do it again. I want to be very step-by-step and explain what's happening (and why) at each step.

Step 1: Getting Clojure (1.3)