Skip to content

Instantly share code, notes, and snippets.

@ChrisLundquist
ChrisLundquist / splitter.rb
Created December 19, 2012 22:12
split apart a monolithic repo into several smaller ones while preserving commit history.
#!/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
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"
@ChrisLundquist
ChrisLundquist / Phad Thai.md
Last active October 11, 2019 02:42
Recipes

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
@ChrisLundquist
ChrisLundquist / euler35.rb
Last active June 10, 2018 01:01
euler 35.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)
//
// 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>
//
// 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>
#!/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
#!/usr/bin/env bash
wget http://www.chakoteya.net/NextGen/{101..277}.htm
#!/usr/bin/env sh
env
@ChrisLundquist
ChrisLundquist / preseed.cfg
Created December 17, 2013 20:34
packer.io preseed file for ubuntu server
# 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
# ------------------