Skip to content

Instantly share code, notes, and snippets.

View cscorley's full-sized avatar
🐷
PIG MODE

Christopher Corley cscorley

🐷
PIG MODE
View GitHub Profile
{
"kind": "discovery#restDescription",
"description": "Business logic for the Meetings app.",
"servicePath": "",
"rootUrl": "https://meetings.googleapis.com/",
"basePath": "",
"ownerDomain": "google.com",
"name": "meetings",
"batchPath": "batch",
"revision": "20181113",
class Test
def thing
@thing ||= "Hi"
end
def thing=(new_thing)
@thing = new_thing
end
def do_stuff
@cscorley
cscorley / gist:1410217
Created November 30, 2011 18:41
Convert directory of svn dumps to git repos
#!/bin/bash
# convert svn dumps located in ./svndumps/ into git repositories.
# assumes dump has basic svn top level structure of tags/, branches/, and trunk/,
# and authors.txt file of the svn committer id -> git committer id
# authors.txt example:
# csc = Christopher Corley <cscorley@ua.edu>
# inspired by/credit to: http://sebastian.formzoo.com/2010/11/04/3-steps-convert-svn-dump-to-git/
@cscorley
cscorley / TerminusBold-Powerline.ttf
Created February 6, 2012 00:01
Terminus (TTF) for Powerline
@cscorley
cscorley / jekyll.py
Last active January 9, 2021 21:47
IPython to Jekyll Markdown
try:
from urllib.parse import quote # Py 3
except ImportError:
from urllib2 import quote # Py 2
import os
import sys
BLOG_DIR = os.environ['BLOG_DIR']
# BLOG_DIR = '/Users/cscorley/git/cscorley.github.io/'
@cscorley
cscorley / worklog-generator.py
Created September 14, 2020 00:17
personal worklog generator for leo
@language python
import datetime
import os.path
worklog_name = 'Worklogs'
numdays = 5 * 365
def generate_node(primary_node, node_name, child=True, body_text=''):
node = g.findNodeInTree(c, primary_node, node_name)
def clone(source, target, bare=False, fresh=False):
if os.path.exists(target) and fresh:
shutil.rmtree(target)
# so dulwich doesn't shit the bed when given a github url
if not source.endswith('.git'):
source = source + '.git'
if not os.path.exists(target):
mkdir(target)
private IDisposable _shimContext { get; set; }
/// <summary>
/// <para>Rules for evaluating expected HTTP requests under test.</para>
/// <para>When a rule is matched, the shim will be set up with the information contained in the tuple: the raw HTTP return code and response string.</para>
/// <para>Each rule is a function and is given the original Uri of the request and, as a convenience, the parsed query portion of the HTTP request.
/// The functions are expected to return a boolean value of whether the parameters match.</para>
/// </summary>
protected Dictionary<Func<Uri, NameValueCollection, bool>, Tuple<HttpStatusCode, string>> expectedHttpRequests;

Keybase proof

I hereby claim:

  • I am cscorley on github.
  • I am cscorley (https://keybase.io/cscorley) on keybase.
  • I have a public key ASDxMaBvgb7zXe9DQlaHKVzbXD7gV1qs8vjJH6RMJG_kyAo

To claim this, I am signing this object:

from ctypes import *
class Cell(Structure):
pass
Cell._fields_ = [
("val", c_int),
("next", POINTER(Cell))]
class LinkedList: