Skip to content

Instantly share code, notes, and snippets.

View aespinosa's full-sized avatar

Allan Espinosa aespinosa

View GitHub Profile
@aespinosa
aespinosa / transfer_sgt.k
Created July 17, 2010 20:19
Karajan broadcast code
We couldn’t find that file to show.
@aespinosa
aespinosa / mk_test.rb
Created October 6, 2010 15:46
OSG site tester
#!/usr/bin/env ruby
# File: mk_test.rb
# Date: 2010-10-06
# Author: Allan Espinosa
# Email: [email protected]
# Description: A Swift workflow generator to test OSG sites through the Engage
# VO. Generates the accompanying tc.data and sites.xml as well.
# Run with "swift -sites.file sites.xml -tc.file tc.data
# test_osg.swift"
@aespinosa
aespinosa / event-to-plot.sorted-start.R
Created April 25, 2011 16:56
R port of plot.sorted-start.png
x<-read.table('filename.event')
x$from<-x$V1-min(x$V1)
x$to<-x$from+x$V2
y<-as.numeric(rownames(x))
x<-x[order(x$from),]
plot(x$to,y, 'n')
segments(x$from,y,x$to,y)
@aespinosa
aespinosa / gist:1590741
Created January 10, 2012 19:42
Update gitignore on non-vim_update_bundle clones of dotvims
~/.vim$ for i in bundle/*/.git/info/exclude; do echo tags >> $i; done
@aespinosa
aespinosa / post-receive.sh
Created January 13, 2012 22:26
Web page post-receive deployment using archive instead of pull or clones
#!/bin/sh
cd /var/wwwroot
git archive --remote /repository/html.git \
--format tar refs/heads/master | tar -xv
@aespinosa
aespinosa / gist:2303196
Created April 4, 2012 15:58
Idea: system ctags
Instead of the long ctags generation on the entire /usr/include . Filter out the libc headers first. Just add as you need based on the *-dev package list.
@aespinosa
aespinosa / gist:2303748
Created April 4, 2012 16:48
Notes: R engineering notation
# Tip from an email in: http://tolstoy.newcastle.edu.au/R/help/06/07/30469.html
formatEng <- function(x) {
s<-as.numeric(strsplit(format(x, scientific=T),"e")[[1]])
return(paste(s[1]*10^(s[2]%%3),as.integer(s[2]-(s[2]%%3)),sep="e"))
}
# Use with sapply on dataframe elements
sapply(x$col, formatEng)
@aespinosa
aespinosa / mendeley.xml
Created May 7, 2012 19:32
Mendeley Opensearch plugin. Install using 'window.external.AddSearchProvider("https://raw.github.com/gist/2629861/1b53261df1a907f26b36a84441d656035945f430/mendeley.xml")' from a DOM console
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<!-- Created on Mon, 07 May 2012 19:29:45 GMT -->
<ShortName>Mendeley</ShortName>
<Description>Mendeley</Description>
<Url type="text/html" method="get" template="http://www.mendeley.com/research-papers/search/?query={searchTerms}"/>
<Image width="16" height="16">http://www.mendeley.com/favicon.ico</Image>
<Developer>Allan Espinosa</Developer>
<InputEncoding>UTF-8</InputEncoding>
@aespinosa
aespinosa / Vagrantfile
Created May 12, 2012 03:29
Removed group and other user writable flag on Windows
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.share_folder "v-root", "/vagrant", ".", extra: "umask=022"
end
@aespinosa
aespinosa / .screenrc
Last active October 13, 2015 00:27
personal .screenrc
shell -$SHELL
#shelltitle 'sometitle'
defscrollback 100000
# Remove some stupid / dangerous key bindings
bind .
bind ^\
bind \\
bind ^h
bind h