Skip to content

Instantly share code, notes, and snippets.

View Gurpartap's full-sized avatar
:octocat:
Working from home

Gurpartap Singh Gurpartap

:octocat:
Working from home
View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.6.3" # parallels/boot2docker recommendation.
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "mitchellh/boot2docker"
config.vm.box_version = "1.2.0"
@Gurpartap
Gurpartap / Dockerfile
Last active August 29, 2015 14:06
Ruby Sinatra docker app for (not just) Kitematic
FROM ubuntu:14.04
RUN apt-get update -qq && \
apt-get install -y make curl -qq && \
apt-get clean && \
curl -sSL "https://github.com/postmodern/ruby-install/archive/master.tar.gz" -o /tmp/ruby-install-master.tar.gz && \
cd /tmp && tar -zxvf ruby-install-master.tar.gz && \
cd /tmp/ruby-install-master && make install && \
apt-get update && \
echo "gem: --no-rdoc --no-ri" >> ~/.gemrc && \
web_1 | Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
web_1 | /redismachine-web/.bundle/ruby/2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `require': cannot load such file -- rubyeventmachine (LoadError)
web_1 | from /redismachine-web/.bundle/ruby/2.1.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `<top (required)>'
web_1 | from /redismachine-web/.bundle/ruby/2.1.0/gems/thin-1.6.2/lib/thin.rb:7:in `require'
web_1 | from /redismachine-web/.bundle/ruby/2.1.0/gems/thin-1.6.2/lib/thin.rb:7:in `<top (required)>'
web_1 | from /redismachine-web/.bundle/ruby/2.1.0/gems/thin-1.6.2/bin/thin:5:in `require'
web_1 | from /redismachine-web/.bundle/ruby/2.1.0/gems/thin-1.6.2/bin/thin:5:in `<top (required)>'
web_1 | from /redismachine-web/.bundle/ruby/2.1.0/bin/thin:23:in `load'
web_1 | from /redismachine-web/.bundle/ruby/2.1.0/bin/thin:23:in `<main>'
@Gurpartap
Gurpartap / gist:6462e56f9341a88bd891
Last active August 29, 2015 14:05
docker build ./sample-app
Sending build context to Docker daemon 4.608 kB
Sending build context to Docker daemon
Step 0 : FROM gurpartap/ruby-build:2.1.2
---> 5c56e02d05ba
Step 1 : RUN mkdir /app
---> Running in 0a041a4be9b5
---> 9fc3f783bf3c
Removing intermediate container 0a041a4be9b5
Step 2 : WORKDIR /app
---> Running in 41c90ff81f3c
FROM gurpartap/ruby-build:2.1.2
RUN mkdir /app
WORKDIR /app
ADD Gemfile /app/Gemfile
RUN bundle install
ADD . /app
EXPOSE 3000
CMD bundle exec thin start
@Gurpartap
Gurpartap / gist:594c5f685664706f4cf8
Last active August 29, 2015 14:05
docker build ./ruby-build
Sending build context to Docker daemon 3.584 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu:14.04.1
---> c4ff7513909d
Step 1 : MAINTAINER Gurpartap Singh <[email protected]>
---> Running in 735544a373de
---> 61ea77fe88b6
Removing intermediate container 735544a373de
Step 2 : ENV HOME /root
---> Running in 630924cf2e99
FROM gurpartap/ruby-build:2.1.2
RUN mkdir /myapp
WORKDIR /myapp
ADD Gemfile /myapp/Gemfile
RUN bundle install
ADD . /myapp
EXPOSE 3000
CMD bundle exec thin start
- (void)setCallbackBlock:(void (^)(id object))callbackBlock
{
//set block as an attribute in runtime
if (callbackBlock) {
objc_setAssociatedObject(self, "dismissBlockCallback", [callbackBlock copy], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
return;
}
void (^block)(id obj) = objc_getAssociatedObject(self, "dismissBlockCallback");
@Gurpartap
Gurpartap / slash.rb
Last active December 15, 2015 02:59
brew formula for http://slash-lang.org/
# brew install ./slash --HEAD --with-lib-dir=/... --sapi=apache2 --with-json --without-mysql
require 'formula'
class Slash < Formula
homepage 'http://slash-lang.org/'
head 'git://github.com/slash-lang/slash.git'
# Core dependencies
depends_on 'gmp'
$ (cat <<'EOP'
name "base"
description "Base role applied to all nodes"
override_attributes(
"chef_client" => {
"server_url" => "https://api.opscode.com/organizations/ORGNAME",
"validation_client_name" => "ORGNAME-validator"
}
)
run_list(