Skip to content

Instantly share code, notes, and snippets.

require 'formula'
class RDownloadStrategy < SubversionDownloadStrategy
def stage
quiet_safe_system 'cp', '-r', @clone, Dir.pwd
Dir.chdir cache_filename
end
end
class R < Formula
import numpy as np
from numba import jit
def root_func(x):
return x**4 - 2*x**2 - x - 3
def compile_specialized_bisect(f):
"""
Returns a compiled bisection implementation for ``f``.
"""
@carlobaldassi
carlobaldassi / PartSort.jl
Last active August 29, 2015 14:18
partial select
module PartSort
using Base.Order
import Base: sort!, Sort.Algorithm
export PartialQuickSort
immutable PartialQuickSort <: Algorithm
k::Int
@ramnathv
ramnathv / create_sphinx_pages.md
Created March 28, 2012 16:02
Hosting Sphinx Documentation on Github

This script has been adapted from a post on LA Times

@mdengler
mdengler / garch.py
Created April 18, 2012 04:38
garch in python, from Peter von Tessin
#!/usr/bin/env python
# Trivial GARCH implementation in python
#
# From Peter Tessin's http://www.petertessin.com/TimeSeries.pdf
#
@jda0
jda0 / farkle.c
Last active June 17, 2016 06:24
Super Awful C to keep scores in a game of Farkle.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Copyright James Daly 2014
// Compile with: gcc farkle.c -std=c99 -o farkle
typedef struct Leader
{
char name[16];
[
// Modified Sublime-REPL keybindings for an "R-friendly" set of shortcuts.
// Copy and paste this text into the Key Bindings - User (under Preferences menu).
// For more information, see http://tomschenkjr.net/2012/05/17/using-sublime-text-2-for-r/
// Executes a selection of text in REPL, latter only displays code and does not execute
{ "keys": ["ctrl+shift+r"], "command": "repl_transfer_current", "args": {"scope": "selection"}},
{ "keys": ["ctrl+shift+r", "r"], "command": "repl_transfer_current", "args": {"scope": "selection", "action":"view_write"}},
// Executes the entire file (build) in REPL, latter only displays code and does not execute
@juliaferraioli
juliaferraioli / Julia-on-GCE-2
Created January 23, 2014 08:38
Import data from Google Cloud Storage, save locally, produce png, and save to Google Cloud Storage.
Pkg.add("Gadfly")
Pkg.add("HTTPClient")
Pkg.add("JSON")
Pkg.add("RDatasets")
using Gadfly
using HTTPClient.HTTPC
using JSON
using RDatasets
@jackparmer
jackparmer / duluth_plotly_theme.json
Created January 26, 2018 01:07
duluth_plotly_theme.json
{
"name": "Duluth",
"reference": {
"marker.color":
["rgb(0,116,217)",
"rgb(255,65,54)",
"rgb(133,20,75)",
"rgb(255,133,27)",
"rgb(255,220,0)",
"rgb(61,153,112)"],