Skip to content

Instantly share code, notes, and snippets.

View roryk's full-sized avatar
😷

Rory Kirchner roryk

😷
View GitHub Profile
@roryk
roryk / gist:4291793
Created December 15, 2012 06:45
Steps through elisp to find an error.
; from http://newsgroups.derkeiler.com/Archive/Comp/comp.emacs/2005-12/msg00064.html saved for posterity
(defalias 'puffer-lesen 'eval-buffer-or-region-step-by-step)
(defun eval-buffer-or-region-step-by-step ()
"Stepps through region if activated, otherwise takes the whole buffer
evaluating last-sexp and messaging point. As `eval-last-sexp' exits
encountering an error, you may easily pick the last point.
Attention: Commands changing the current-buffer as `find-file' will
derail the check."
(interactive)
<style TYPE="text/css">
code.has-jax {font: inherit; font-size: 100%; background: inherit; border: inherit;}
</style>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'] // removed 'code' entry
}
});
@roryk
roryk / gist:4476452
Last active December 10, 2015 18:39
# to add latex equations to a Rmd file, enclose the equations using the $ $ syntax
# and run knit_equation on the Rmd file instead of knit
knit_equation = function(rmd, md) {
require('knitr')
require('RCurl')
gist_url = 'https://gist.github.com/roryk/4476421/raw/d08080c206b5663e0451a5ef6c56635a0c6f0f17/gistfile1'
#gist_url = 'https://gist.github.com/raw/4476421/d08080c206b5663e0451a5ef6c56635a0c6f0f17/gistfile1'
tmp = tempfile()
knit(rmd, tmp)
f = file(md, "w")
@roryk
roryk / gist:10662773
Created April 14, 2014 16:23
libmaus 0.0.104 OSX patch
diff -rupN libmaus-0.0.104-release-20140221093548/src/libmaus/aio/PosixFdInput.hpp new/src/libmaus/aio/PosixFdInput.hpp
--- libmaus-0.0.104-release-20140221093548/src/libmaus/aio/PosixFdInput.hpp 2014-02-21 04:36:04.000000000 -0500
+++ new/src/libmaus/aio/PosixFdInput.hpp 2014-04-14 12:21:04.000000000 -0400
@@ -46,7 +46,10 @@ namespace libmaus
public:
static int getDefaultFlags()
{
+ #ifndef __APPLE__
return O_RDONLY|O_NOATIME|O_LARGEFILE;
+ #endif
diff -rupN libmaus-0.0.104-release-20140221093548/src/libmaus/aio/PosixFdInput.hpp new/src/libmaus/aio/PosixFdInput.hpp
--- libmaus-0.0.104-release-20140221093548/src/libmaus/aio/PosixFdInput.hpp 2014-02-21 04:36:04.000000000 -0500
+++ new/src/libmaus/aio/PosixFdInput.hpp 2014-04-14 12:21:04.000000000 -0400
@@ -46,7 +46,10 @@ namespace libmaus
public:
static int getDefaultFlags()
{
+ #ifndef __APPLE__
return O_RDONLY|O_NOATIME|O_LARGEFILE;
+ #endif
import gffutils
import os
gtf = "path/to/your/gtf/file"
def get_gtf_db(gtf, in_memory=False):
db_file = ":memory:" if in_memory else gtf + ".db"
if in_memory or not os.path.exists(db_file):
db = gffutils.create_db(gtf, dbfn=db_file)
if in_memory:

Keybase proof

I hereby claim:

  • I am roryk on github.
  • I am roryk (https://keybase.io/roryk) on keybase.
  • I have a public key whose fingerprint is 7C28 113B F748 6132 2854 81AD 06E8 EF6A D433 A483

To claim this, I am signing this object:

@roryk
roryk / gist:3aade4cc66af6db93496
Created October 27, 2014 21:15
STAR error 2.4.0e with --quantMode
STAR version=STAR_2.4.0e
STAR compilation time,server,dir=Fri Oct 24 10:43:53 EDT 2014 verona.cshl.edu:/sonas-hs/gingeras/nlsas_norepl/user/dobin/STAR/STAR.sandbox/source
##### DEFAULT parameters:
versionSTAR 20201
versionGenome 20101 20200
parametersFiles -
runMode alignReads
runThreadN 1
genomeDir ./GenomeDir/
genomeLoad NoSharedMemory
@roryk
roryk / gist:16b3240c12f09d6c9619
Created December 3, 2014 18:54
commander.txt
MOD_NAME=Commander's Choice - LW
AUTHOR=Peasly Wellbott
DESCRIPTION=Choose the class of your Squaddies! When being prompted to pick a Squaddie's first skill, the "Cycle Soldier" buttons on the bottom of the screen will instead cycle the soldier's class! Does not affect MECs or any soldier who has locked in their specialty, but should work for reward soldiers and special soldiers.
Version: 1.0
Compatible with XCOM Long War versions:
- All hopefully
>chrM
GTTAATGTAGCTTAATAACAAAGCAAAGCACTGAAAATGCTTAGATGGAT
AATTGTATCCCATAAACACAAAGGTTTGGTCCTGGCCTTATAATTAATTA
GAGGTAAAATTACACATGCAAACCTCCATAGACCGGTGTAAAATCCCTTA
AACATTTACTTAAAATTTAAGGAGAGGGTATCAAGCACATTAAAATAGCT
TAAGACACCTTGCCTAGCCACACCCCCACGGGACTCAGCAGTGATAAATA
TTAAGCAATAAACGAAAGTTTGACTAAGTTATACCTCTTAGGGTTGGTAA
ATTTCGTGCCAGCCACCGCGGTCATACGATTAACCCAAACTAATTATCTT
CGGCGTAAAACGTGTCAACTATAAATAAATAAATAGAATTAAAATCCAAC
TTATATGTGAAAATTCATTGTTAGGACCTAAACTCAATAACGAAAGTAAT