most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
### Here's one way to do it. | |
library(igraph) | |
library(ggplot2) | |
## The igraph docs say that vertex.label.degree controls the position | |
## of the labels with respect to the vertices. It's interpreted as a | |
## radian, like this: | |
## | |
## Value is : Label appears ... the node |
# Find all markdown files | |
path = File.join(File.dirname(__FILE__), "source", "**/*.html.markdown") | |
# Also generate .latex files along side | |
Dir[path].each do |markdown_file| | |
http_path = markdown_file.split("source").last.gsub(".html.markdown", "") | |
page "#{http_path}.latex", :proxy => "#{http_path}.html", :latex => true, :layout => false | |
end | |
require "fileutils" |
(function(d) { | |
var dl = d.createElement('a'); | |
dl.innerText = 'Download MP3'; | |
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1]; | |
dl.download = d.querySelector('em').innerText+".mp3"; | |
d.querySelector('.primary').appendChild(dl); | |
dl.style.marginLeft = '10px'; | |
dl.style.color = 'red'; | |
dl.style.fontWeight = 700; | |
})(document); |
#Mac OS X
#!/bin/sh | |
## Information | |
## http://carlo-hamalainen.net/blog/2007/12/11/installing-minion-pro-fonts/ | |
## http://www.ctan.org/tex-archive/fonts/mnsymbol/ | |
## 0.1: Install LCDF Typetools | |
## http://www.lcdf.org/type/ | |
## If you use Homebrew (http://mxcl.github.com/homebrew/), then uncomment: | |
# brew install lcdf-typetools |
# Initial setup | |
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name | |
cd project-name | |
git checkout --orphan master | |
git commit -m "Initial commit" | |
# Pulling changes | |
git fetch framework | |
git merge --squash -m "Upgrade Laravel" framework/develop | |
# Fix merge conflicts if any and commit |
Having trouble installing the latest stable version of tmux?
I know, official package for your OS/distro is outdated and you just want the newest version of tmux.
Well, this script should save you some time with that.
# Test of Significance, takes the same arguments as t.test() . | |
signif.test <- function(x, ...) { | |
p <- t.test(x, ...)$p.value | |
# List of p excuses retrieved from http://mchankins.wordpress.com/2013/04/21/still-not-significant-2/ | |
p_excuses <- c( | |
"(barely) not statistically significant <p>", | |
"a barely detectable statistically significant difference <p>", | |
"a borderline significant trend <p>", | |
"a certain trend toward significance <p>", |
#' When plotting multiple data series that share a common x axis but different y axes, | |
#' we can just plot each graph separately. This suffers from the drawback that the shared axis will typically | |
#' not align across graphs due to different plot margins. | |
#' One easy solution is to reshape2::melt() the data and use ggplot2's facet_grid() mapping. However, there is | |
#' no way to label individual y axes. | |
#' facet_grid() and facet_wrap() were designed to plot small multiples, where both x- and y-axis ranges are | |
#' shared acros all plots in the facetting. While the facet_ calls allow us to use different scales with | |
#' the \code{scales = "free"} argument, they should not be used this way. | |
#' A more robust approach is to the grid package grid.draw(), rbind() and ggplotGrob() to create a grid of | |
#' individual plots where the plot axes are properly aligned within the grid. |