Skip to content

Instantly share code, notes, and snippets.

View hernamesbarbara's full-sized avatar

austin hernamesbarbara

View GitHub Profile
@justjkk
justjkk / ph.py
Created May 4, 2012 13:34
CLI Wrapper around python-phonenumbers library
#!/usr/bin/env python
"""Minimal CLI wrapper around phonenumbers library so that PHP can use it
Author: Kishore Kumar <justjkk@gmail.com>
Usage: python ph.py <command> <args>
Commands:
help - Print this
@stefanv
stefanv / random_walk.py
Created January 24, 2012 22:05
Random walk example
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_xlim(-10, 10)
ax.set_aspect(1)
x = [0]
@ch-gilbert
ch-gilbert / Sublime-BracketHighlighter-Style.xml
Last active December 20, 2015 12:19
<Sublime BracketHighlighter> Highlight Style Configuration (add this part config into your color theme file)
<!--BracketHighlighter-->
<dict>
<key>name</key>
<string>Bracket Unmatched</string>
<key>scope</key>
<string>brackethighlighter.unmatched</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FF0000</string>
@drewconway
drewconway / deploy.R
Created August 19, 2013 15:18
Template for deploying draft predictions for Yhat Fantasy Football Challenge using R
library(yhatr)
model.require <- function() {
library(plyr)
}
model.transform <- function(df) {
df
}
anonymous
anonymous / 01.configure
Created October 24, 2013 22:00
This is the Qt for Mac OS X Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.
You have already accepted the terms of the license.
@bbengfort
bbengfort / similarity.py
Last active February 2, 2016 19:00
Computation of similarity scores - Euclidean Distance and Pearson Correlations
#!/usr/bin/env python
import operator
from math import sqrt
from reader import PreferenceReader
class SimilarityScoring(PreferenceReader):
"""
Extends the preference reader class to give our data structure the
@gabraganca
gabraganca / output_toggle_html.tpl
Last active February 15, 2017 17:37
Template to use with `ipython nbconvert` when generating HTML. With this, all input cell are hidden. Thanks @damianavila for the initial setup (http://www.damian.oquanta.info/posts/hide-the-input-cells-from-your-ipython-slides.html). I have also take some code from the `custom.css` of @olgablot published in http://nbviewer.ipython.org/5357268.
{%- extends 'full.tpl' -%}
{% block input_group -%}
<div class="input_hidden">
{{ super() }}
</div>
{% endblock input_group %}
{%- block header -%}
{{ super() }}
@hannes-brt
hannes-brt / ipy_hide_input
Created August 12, 2013 00:20
This is a simple command line tool that adds a small snippet of Javascript to the end of the HTML output of `ipython nbconvert` that hides the input code in the output. This works for both '--to html' and '--to slides' The tool works both when given a file name or by reading from stdin: ```bash ipy_hide_input input_file.slides.html ipython nbcon…
#! /usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2013 Hannes Bretschneider
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
.highlight {
background-color: yellow;
}
'use strict';
import template from './highlightable.html!text';
import controller from './highlightable.controller';
import './highlightable.css!';
// use: <div highlightable hightlight="<scope guard variable>">content</div>
let highlightableComponent = function() {
return {
template,
controller,