Skip to content

Instantly share code, notes, and snippets.

@molly
molly / jagged
Created October 23, 2014 01:58
Jagged arrays
a = [1, 2, 3]
b = [4, 5]
c = [6, 7, 8, 9, 10]
all = [a, b, c]
print(all)
# > [[1, 2, 3], [4, 5], [6, 7, 8, 9, 10]]
for y in all:
list = ["asdfasdfasdfaasdf", "asdfasdfasdfaasdf", "asdfasdfasdfaasdf", "asdfasdfasdfaasdf",
"asdfasdfasdfaasdf", "asdfasdfasdfaasdf"]
@molly
molly / molly_R.R
Last active August 29, 2015 14:07 — forked from Ironholds/molly_R.R
intertimes <- function(x, local_minimum){
return(sum(x > local_minimum) + 1)
}
//Includes/namespaces
#include <Rcpp.h>
using namespace Rcpp;
// Recursive session counting function
// [[Rcpp::export]]
int session_count(NumericVector x, int local_minimum) {
//Create output object
int count = 1;
r'reddit\.com/(?:u(?:ser)?/(?P<user>.+?)(?:\Z|#|/)|r/(?P<sub>.+?)(?:/?\Z|/comments/(?P<id>.+?)(?:/?\Z|/(?P<title>.+?)(?:/?\Z|/(?P<cid>.+?)(?:/|#|\Z)))))'
@molly
molly / secrets.py
Created February 21, 2014 15:20
secrets.py
C_KEY = ""
C_SECRET = ""
A_TOKEN = ""
A_TOKEN_SECRET = ""
GUARDIAN_KEY = ""
@molly
molly / gist:5253701
Last active December 15, 2015 11:29
Text that causes issues with pandoc

CFM International CFM56

Infobox from CFM International CFM56 causes pandoc to fail to build.

{|{{Infobox aircraft begin
 |name= CFM56
 |image= File:CFM56 P1220759.jpg
 |alt=An exposed jet engine at a trade show. The rear of the polished metal fan case is visible on the left. The outer casing of the compressor section, covered in fuel lines and electrical wires is in to the right of the fan case. The right of the image shows the back of the engine, the exhaust area of the turbine section.
 |caption= Rear view of CFM56-5
}}