Skip to content

Instantly share code, notes, and snippets.

@bringhurst
bringhurst / gist:385651
Created April 30, 2010 19:30
Subversion multiple project checkout script
#!/bin/bash
usage()
{
cat << EOF
usage: $0 [options] segments ...
This script will checkout the specified segment(s) from trunk.
OPTIONS:
@bringhurst
bringhurst / Anti-debugger nullpad
Created July 17, 2010 18:53
A example of a nop pad which confuses gdb's function boundary testing..
#define NPAD_START asm volatile ( \
"pushl %eax \n"
"movl %esp, %eax\n")
#define NPAD asm volatile ("addb %al, (%eax)\n")
#define NPAD_END asm volatile ("popl %eax\n")
#define NPAD_40 NPAD_START; \
NPAD; NPAD; NPAD; NPAD; \
NPAD; NPAD; NPAD; NPAD; \
NPAD; NPAD; NPAD; NPAD; \
NPAD; NPAD; NPAD; NPAD; \
@bringhurst
bringhurst / WebGL Context Debug Wrapper
Created July 30, 2010 17:31
A webgl debug wrapper modified for use in google closure apps.
/*global goog, lanyard */
/*jslint white: false, onevar: false, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, sub: true, nomen: false */
//
// WARNING: Part of this file is based on code that is:
//
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file (located in the Khronos Group's VCS repository).
//
@bringhurst
bringhurst / prototype ingredient for java
Created February 16, 2011 00:29
A sample of ingredient's DSL
##
## An ingredient file.
##
#
# Give a basic name and description of the package this ingredient file configures.
#
name 'jdk1.6.0_20'
description 'java for use on service nodes'
<!DOCTYPE html>
<html lang="en">
<head>
<script id="fragmentShader" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
void main() {
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
bin/cucumber --require features/ features/example-script.feature
class BuildingsController < ApplicationController
def destroy
@building = Building.find params[:id]
begin
@building.destroy
rescue
flash[:notice] = $!.message
end
@bringhurst
bringhurst / osx_shot_in_the_dark.patch
Created May 16, 2011 21:35
A patch to remove a weak linking hack for some old version of osx
diff --git a/src/plugins/select/cons_res/select_cons_res.c b/src/plugins/select/cons_res/select_cons_res.c
index f138c04..40be7d2 100644
--- a/src/plugins/select/cons_res/select_cons_res.c
+++ b/src/plugins/select/cons_res/select_cons_res.c
@@ -109,22 +109,6 @@
#define NODEINFO_MAGIC 0x82aa
-/* These are defined here so when we link with something other than
- * the slurmctld we will have these symbols defined. They will get
@bringhurst
bringhurst / clang patch
Created January 27, 2012 20:54
patch to get things working on clang
diff --git a/switch/SwitchCore.c b/switch/SwitchCore.c
index 3a88df0..1c28bab 100644
--- a/switch/SwitchCore.c
+++ b/switch/SwitchCore.c
@@ -262,13 +262,13 @@ int SwitchCore_addInterface(struct Interface* iface,
if (ifIndex == SwitchCore_MAX_INTERFACES) {
return -1;
}
- memcpy(&core->interfaces[ifIndex], &(struct SwitchInterface) {
+ memcpy(&core->interfaces[ifIndex], (&(struct SwitchInterface) {
@bringhurst
bringhurst / gist:1693075
Created January 28, 2012 06:42
How to create a tun in osx without installing 3rd party crap
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/kern_control.h>
#include <sys/ioctl.h>
#include <sys/sys_domain.h>
#include <sys/kern_event.h>
#include <sys/errno.h>
#define UTUN_CONTROL_NAME "com.apple.net.utun_control"