Skip to content

Instantly share code, notes, and snippets.

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@domoritz
domoritz / wos.php
Created March 10, 2012 19:32 — forked from pol/wos.php
Web of Science API access with ruby, python and php libs
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
$search_client = @new SoapClient($search_url);
$search_client->__setCookie('SID',$auth_response->return);
$search_array = array(
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@noamross
noamross / organize_pdfs
Created October 5, 2012 16:21
Remove cover pages from PDFs and make links to sync recent additions
#!/bin/bash
# This script is set to run any time a new file is added to my "Papers" folder, using launchd
# 1 - Find papers with JSTOR or Science cover sheets and remove the first page
text1="kind:pdf Your use of the JSTOR archive indicates your acceptance of" #JSTOR papers
text2="kind:pdf is published weekly, except the last week in December" #Science papers
#Add more of these as you find text snippets that identify cover sheets from different publishers. Then add more loops belo
@mrdwab
mrdwab / LinearizeNestedList.R
Created December 4, 2012 16:00
Un-nest a nested list in R
LinearizeNestedList <- function(NList, LinearizeDataFrames=FALSE,
NameSep="/", ForceNames=FALSE) {
# LinearizeNestedList:
#
# https://sites.google.com/site/akhilsbehl/geekspace/
# articles/r/linearize_nested_lists_in_r
#
# Akhil S Bhel
#
# Implements a recursive algorithm to linearize nested lists upto any
@nachocab
nachocab / instructions.sh
Last active February 13, 2022 15:45
How to make git diff work perfectly with .docx files in Mac OS X (it even colors by word)
# download docx2txt by Sandeep Kumar
wget -O docx2txt.pl http://www.cs.indiana.edu/~kinzler/home/binp/docx2txt
# make a wrapper
echo '#!/bin/bash
docx2txt.pl $1 -' > docx2txt
chmod +x docx2txt
# make sure docx2txt.pl and docx2txt are your current PATH. Here's a guide
http://shapeshed.com/using_custom_shell_scripts_on_osx_or_linux/
@hadley
hadley / frndly.r
Created September 27, 2013 20:04
# A tutorial navigates through a series of states, either manually, with
# nxt(), prv(), jmp() etc, or automatically, by using addTaskCallback() and
# checking that preconditions are met.
#
# Each state has:
# * a message
# * a next state (a function name)
# (eventually may have multiple next named states)
# * an auto test
#
@dbreunig
dbreunig / ReporterSaveFileDescription.md
Last active January 22, 2021 16:07
A description of the data written to the Reporter App Dropbox save folder.

#Reporter Save File Schema

##The Reporter Export File

Reporter saves to your Dropbox account with plaintext JSON files, one for each day. When a Report is entered in the app a file is created for that day if it does not exist. Otherwise, the report is appended to the existing file. The save folder is located in 'Dropbox/Apps/Reporter-App/'.

Reporter save files are named according to the following convention:

YYYY-MM-DD-reporter-export.json
@aammd
aammd / fizzbuzz.md
Last active January 25, 2017 08:25
An example of calculating "FizzBuzz" in R using dplyr and magrittr

Apparently, there is a simple problem called Fizz buzz which is sometimes used to identify competent programmers. A good opportunity to practice some dplyr and magrittr tricks.

library(dplyr)
library(magrittr)
library(knitr)

1:100 %>%
 data.frame %&gt;%
@woobe
woobe / README.md
Last active December 21, 2017 16:41
[rPlotter]: Customised Palette Experiments

Introduction

I created a function called "extract_colours()" in my "rPlotter" package. Using this function, any image in PNG, JPG, JPEG or TIFF format can be converted into a simple colour palette.

YET, this is my very first attempt, the colours are only sorted by alphabetical order at the moment. More work is needed to arrange colours based on colour theory and other factors.

Example 1a - R Logo R Logo

Output 1a