Skip to content

Instantly share code, notes, and snippets.

# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool for host, linux/amd64.
lib9
libbio
libmach
misc/pprof
cmd/addr2line
cmd/cov
@manveru
manveru / PKGBUILD
Created April 15, 2013 08:24
ssh-installkeys PKGBUILD
# Maintainer: Jaroslav Lichtblau <[email protected]>
# Contributor: Michael Fellinger <[email protected]>
pkgname=ssh-installkeys
pkgver=1.7
pkgrel=1
pkgdesc="Set up password-less SSH logins"
arch=('any')
url="http://www.catb.org/~esr/$pkgname"
license=('BSD')
#!/usr/bin/env ruby
fail "Please specify a string first and then the directory second" if ARGV.size != 2
query, location = *ARGV
puts "you're looking for #{query} in #{location}"
def grep(query, file)
File.open file do |fd|
fd.each_line do |line|
@manveru
manveru / sandbox.rb
Last active December 12, 2015 07:48
This little executable creates sandboxes from git repositories using `git archive`.
#!/usr/bin/env ruby
# This little executable creates sandboxes from git repositories using `git archive`.
#
# It creates the sandbox initially in a temporary directory, and a .tar.bz2 is
# made from the result.
#
# Dependencies are put into <name>/vendor/<dependency-basename> directories.
#
# Easy requires in your application are done by:
require 'benchmark'
require 'digest/sha2'
java_import 'java.security.MessageDigest'
def jhex(s)
md = MessageDigest.getInstance("SHA-256")
md.update(s.to_java(:String).getBytes)
md.digest.to_a.pack('C*').unpack('H*')
end
class KeyMetrics
def initialize(date, day)
@@data = Metric.last(source: 'all', start_date: date, end_date: date)
p 'DATA'
p @@data
end
def find
{
visits: @@data.visits.to_s,
revenue: CURRENCY + sdlw_data.transaction_revenue.to_s
@manveru
manveru / rvm.worker
Created November 22, 2012 20:09
RVM binaries on IronWorker
runtime 'binary'
exec 'rvm_install.sh'
@manveru
manveru / config.ru
Created October 30, 2012 09:50
Rack & ERB
require './form_rack'
use Rack::ShowExceptions
use Rack::Lint
use Rack::ContentLength
run MyApp.new
@manveru
manveru / call.rb
Created October 3, 2012 14:36
ironworker and twilio
require 'twilio-ruby'
Twilio::REST::Client.new(
@params['twilio']['sid'],
@params['twilio']['token']
).account.calls.create(
from: @params['twilio']['from'],
to: @params['to'],
url: @params['twilio']['url'],
)
@manveru
manveru / build.sh
Created August 8, 2012 19:04
IronWorker with rvm
#!/bin/bash
export HOME=/task
# install rvm
curl -L https://get.rvm.io | bash -s stable --ruby
. $HOME/.rvm/scripts/rvm
# install rubinius with hello gemset