Skip to content

Instantly share code, notes, and snippets.

@ChrisLundquist
ChrisLundquist / splitter.rb
Created Dec 19, 2012
split apart a monolithic repo into several smaller ones while preserving commit history.
View splitter.rb
#!/usr/bin/env ruby
BASE_REMOTE_URL = "git@github.blueboxgrid.com:chef"
folders = ARGV
pwd = Dir.pwd
folders.each do |folder|
name = folder.split("/").last
name = name.gsub("-","_")
clone_command = "git clone chef/ #{name}"
system clone_command
Dir.chdir name
View configure.ac.diff
diff --git a/configure.ac b/configure.ac
index f713ce1..94b986c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2552,8 +2552,8 @@ AC_ARG_WITH(libmongoc, [AS_HELP_STRING([--with-libmongoc@<:@=PREFIX@:>@], [Path
with_libmongoc="no"
else
with_libmongoc="yes"
- LIBMONGOC_CPPFLAGS="$LIBMONGOC_CPPFLAGS -I$withval/include"
- LIBMONGOC_LDFLAGS="$LIBMONGOC_LDFLAGS -L$withval/lib"
View Phad Thai.md

Serves 4

  • 1/4 cup white sugar
  • 2 tablespoons fish sauce
  • 2 tablespoons lime juice
  • 2 tablespoon tamarind concentrate (mixed with 1/4 cup water)
  • 1/2 (12 ounce) package dried rice noodles
  • 1/4 cup vegetable oil
  • 3/4 teaspoon minced garlic
  • 2 eggs
View euler35.rb
#!/usr/bin/env ruby
# The number, 197, is called a circular prime because all rotations of the digits: 197, 971, and 719, are themselves prime.
# There are thirteen such primes below 100: 2, 3, 5, 7, 11, 13, 17, 31, 37, 71, 73, 79, and 97.
#How many circular primes are there below one million?
#
require 'prime'
candidates = [2] + Prime.each(1_000_000).reject { |p| p.digits.any? { |d| d.even? } }
def siblings(int)
View fs_capabilities.m
//
// fs_capabilities.m
//
// Created by Charles Francoise on 13/05/14.
// Copyright (c) 2014 Charles Francoise. All rights reserved.
//
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
View fs_capabilities.m
//
// fs_capabilities.m
//
// Created by Charles Francoise on 13/05/14.
// Copyright (c) 2014 Charles Francoise. All rights reserved.
//
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
View two-sum.rb
#!/usr/bin/env ruby
def find_pair!(data, target)
# We know we won't use a value greater than our target
data.reject! { |i| i > target }
# Sort it so we don't have to scan our list a bunch
data.sort!
# If our two biggest numbers are lower than the target, we're boned
View get_episodes.sh
#!/usr/bin/env bash
wget http://www.chakoteya.net/NextGen/{101..277}.htm
@ChrisLundquist
ChrisLundquist / preseed.cfg
Created Dec 17, 2013
packer.io preseed file for ubuntu server
View preseed.cfg
# Installation
# ============
# Installation of Ubuntu Server 13.04 “Raring Ringtail” is automated by
# 'preseeding' configuration options with the values expected for vagrant. The
# `ubuntu-server/raring64/preseed.cfg` file defines these options.
# Clock and Timezone
# ------------------