Skip to content

Instantly share code, notes, and snippets.

View svaksha's full-sized avatar
💭
zzZen()

svaksha ॥ स्वक्ष ॥ svaksha

💭
zzZen()
View GitHub Profile
@svaksha
svaksha / FArray.jl
Created September 28, 2015 02:28 — forked from alsam/FArray.jl
Julia implementation Fortran-like array with arbitrary starting indices, negative or zero. Incurs a reasonable overhead vs. Base.Array, expected performance degradation should be strictly less than 2x.
# Fortran-like array with arbitrary starting indices
#
# usage:
#
# julia> include("FArray.jl")
# size (generic function with 51 methods)
#
# julia> y = FArray(Float64, -1:1, -7:7, -128:512, -5:5, -1:1, -3:3, -2:2, -1:1);
#
# julia> y[-1,-7,-128,-5,-1,-3,-2,-1] = 14
@svaksha
svaksha / hn_seach.js
Last active September 12, 2015 11:52 — forked from meiamsome/hn_search.js
hn job query search
// takes arguments and produces an array of functions that accept context
function handle_args() {
var args = Array.prototype.slice.call(arguments);
return args.map(function(arg) {
if(arg instanceof Function) return arg; // Presumably already a contex-accepting function.
if(arg instanceof Array) return and.apply(this, arg); // make arrays behave as and.
// Presuming a string, build a function to check.
var my_regex = new RegExp(arg.toString(), 'i');
return function(context) {
return context.search(my_regex) > -1;
@svaksha
svaksha / hn_seach.js
Last active September 12, 2015 11:52 — forked from kristopolous/hn_seach.js
hn job query search
function query() {
var
total = 0, shown = 0,
// HN is done with very unsemantic classes.
job_list = Array.prototype.slice.call(document.querySelectorAll('.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list = Array.prototype.slice.call(arguments);
// This traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.className === klass) {
@svaksha
svaksha / mapping.jl
Last active August 29, 2015 14:18 — forked from rofinn/mapping.jl
@doc doc"""
Takes a 2d array where each column is a pattern which maps to a row in
the resulting dataframe. Each pattern index is its own column in
the dataframe.
""" ->
function DataFrame(data::Array{Float64, 2})
m = data'
result = DataFrame()
for i in 1:size(data, 1)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@svaksha
svaksha / .pythonrc
Last active August 29, 2015 14:06 — forked from dlo/.pythonrc
# http://dlo.me/archives/2014/09/08/pythonrc/
# vim: set ft=python :
from __future__ import print_function
import json
import sys
import datetime
from redis import StrictRedis as Redis
#!/usr/bin/env python
import os
import logging
from collections import Counter
import gffutils
from gffutils.create import logger
logger.setLevel(logging.INFO)
usage = """
.ipynb_checkpoints
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.