Skip to content

Instantly share code, notes, and snippets.

Avatar
🐷
PIG MODE

Christopher Corley cscorley

🐷
PIG MODE
View GitHub Profile
View why_nil.rb
class Test
def thing
@thing ||= "Hi"
end
def thing=(new_thing)
@thing = new_thing
end
def do_stuff
@cscorley
cscorley / worklog-generator.py
Created Sep 14, 2020
personal worklog generator for leo
View worklog-generator.py
@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)
View clone-github.py
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)
View testbonehead.cs
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;
View keybase.md

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:

View proposal.md

the general algo goes like so:

for chunk in corpus:
  e-step
  m-step

gensim hacks in multiple passes:

View linkedlist.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from node import Node
class LinkedList:
def __init__(self, iterable=None):
last = None
if iterable:
for item in reversed(iterable):
@cscorley
cscorley / README.md
Last active Aug 29, 2015
Teaching SOP
View README.md
View antigabors.tex
\newcommand{\attn}[1]{{\color{red}#1}}
\newcommand{\desc}[1]{{\emph{\color{blue}#1}}}
\newcommand{\needcite}{\attn{\tiny{[cite]}}}
@cscorley
cscorley / iup.py
Last active Aug 29, 2015
internet uptime script
View iup.py
#!/usr/bin/python3
import sqlite3
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from dateutil.parser import parse
conn = sqlite3.connect('iup.db')
c = conn.cursor()