Skip to content

Instantly share code, notes, and snippets.

@reinholdsson
reinholdsson / countries.geo.json
Last active December 15, 2015 22:19
WDI geoJSON (originally from https://github.com/johan/world.geo.json, but removed countries that doesn't match to WDI data)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
@bclinkinbeard
bclinkinbeard / gist:2698389
Created May 15, 2012 01:15
D3.js scatterplot in CoffeeScript
dataset = []
w = 500
h = 400
padding = 30
dataset.push [ Math.random() * w, Math.random() * h ] for [0..50]
svg = d3.select("body")
.append("svg")
.attr("width", w)
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@artero
artero / launch_sublime_from_terminal.markdown
Last active September 12, 2024 02:13 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
anonymous
anonymous / dbWriteTable.fast.R
Created May 12, 2011 13:00
Function to get problematic data into PostgreSQL from R (uses RPostgreSQL)
# Function to get data over to PostgreSQL quickly and with minimal loss
# of information due to data type conversions.
# Note that I have had cases where the pipe() call returned an error due
# to lack of memory. So care should be taken with this function
dbWriteTable.fast <- function (conn,name,value,row.names=FALSE,
overwrite=TRUE,fix.names=TRUE) {
# Conform names to PostgreSQL requirements
pg.names <- make.db.names(conn,names(value))