Skip to content

Instantly share code, notes, and snippets.

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

svaksha ॥ स्वक्ष ॥ svaksha

💭
zzZen()
View GitHub Profile
@svaksha
svaksha / jvm
Created October 20, 2015 11:48 — forked from tmlbl/jvm
JVM - Julia Version Manager
#!/bin/bash
# I keep Julia binaries in /opt/julia with the same directory structure
# as ~/.julia to store different versions, and use this script to switch
# between them. I also like to maintain a link of the ~/.julia folder to
# ~/julia, for easier package development.
JBIN=""
PDIR=""
@svaksha
svaksha / meetup.jl
Created October 20, 2015 11:48 — forked from tmlbl/meetup.jl
Script to find Julia developers in your area using the GitHub API
using HTTPClient: HTTPC
using JSON
# Fill in your city name and GitHub API token
const MEETUP_LOCATION = lowercase("Seattle")
const API_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Pages of search results to examine. Warning - you WILL hit the rate limit
const NUM_PAGES = 1
typealias Field Union{AbstractString,Void}
@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 / Julia-Segmentation-fault
Last active August 29, 2015 14:27
Segmentation fault
On Ubuntu14-04-LTS, using git-master `f3217a8d123e51f534` 2015-08-17, julia throws this error:
स्वक्ष@ilak:~/julia$ ju
signal (11): Segmentation fault
unknown function (ip: 0x7f35398dca3b)
unknown function (ip: 0x7f35398dcd84)
jl_restore_incremental at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
_require_from_serialized at loading.jl:72
jlcall__require_from_serialized_20926 at (unknown line)
jl_apply_generic at /usr/bin/../lib/x86_64-linux-gnu/julia/libjulia.so (unknown line)
@svaksha
svaksha / 20150721-23@pydiversity
Created July 24, 2015 17:01
20150721-23@pydiversity
2015-07-20:CEST:11:13:24 [Users #pydiversity]
2015-07-20:CEST:11:13:24 [ __love__] [ cwarner] [ svaksha] [ treyhunner] [ willingc_]
2015-07-20:CEST:11:13:24 -!- Irssi: #pydiversity: Total of 5 nicks [0 ops, 0 halfops, 0 voices, 5 normal]
2015-07-20:CEST:11:13:25 -!- mode/#pydiversity [+o svaksha] by ChanServ
2015-07-20:CEST:11:14:14 -!- Channel #pydiversity created Mon Aug 4 20:45:27 2014
2015-07-20:CEST:11:16:25 -!- Irssi: Join to #pydiversity was synced in 212 secs
Day changed to 21 juil. 2015
2015-07-21:CEST:21:55:02 < __love__> kushal: ping
2015-07-21:CEST:21:55:12 < kushal> __love__, hello
2015-07-21:CEST:21:56:03 < kushal> __love__, How are you?
@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.