Skip to content

Instantly share code, notes, and snippets.

View christinebuckler's full-sized avatar

Christine christinebuckler

View GitHub Profile
@orclev
orclev / tst.py
Created February 29, 2012 04:09
Python TST implementation
# -*- coding: utf-8 -*-
# Copied from https://bitbucket.org/woadwarrior/trie/src/0ca6aab259b2/python/tst.py
_SENTINEL = ()
class TST(object) :
__slots__ = ('splitchar','l','m','r','v')
def __init__( self, ch=None ) :
self.splitchar = ch

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@paulgb
paulgb / binom_interval.py
Created September 19, 2013 17:58
Compute two-sided binomial confidence interval in Python. Based on R's binom.test.
from scipy.stats import beta
def binom_interval(success, total, confint=0.95):
quantile = (1 - confint) / 2.
lower = beta.ppf(quantile, success, total - success + 1)
upper = beta.ppf(1 - quantile, success + 1, total - success)
return (lower, upper)
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@jlln
jlln / separator.py
Last active November 9, 2023 19:59
Efficiently split Pandas Dataframe cells containing lists into multiple rows, duplicating the other column's values.
def splitDataFrameList(df,target_column,separator):
''' df = dataframe to split,
target_column = the column containing the values to split
separator = the symbol used to perform the split
returns: a dataframe with each entry for the target column separated, with each element moved into a new row.
The values in the other columns are duplicated across the newly divided rows.
'''
def splitListToRows(row,row_accumulator,target_column,separator):
split_row = row[target_column].split(separator)
@karpathy
karpathy / min-char-rnn.py
Last active July 12, 2024 06:09
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@amyghotra
amyghotra / pygame_snow2.py
Last active December 20, 2018 17:19
Using python, create continuously falling snow.
import pygame
import random
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
BLUE = (0, 0, 255)
@schnell18
schnell18 / macosx_remove_java9.sh
Created October 8, 2016 13:26
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active July 16, 2024 09:07
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux