Skip to content

Instantly share code, notes, and snippets.

View ravnoor's full-sized avatar

Ravnoor Singh Gill ravnoor

View GitHub Profile
@ravnoor
ravnoor / simple_mlp_theano.py
Created April 26, 2017 11:42 — forked from vinhkhuc/simple_mlp_theano.py
Simple Feedforward Neural Network using Theano
# Implementation of a simple MLP network with one hidden layer. Tested on the iris data set.
# Requires: numpy, sklearn, theano
# NOTE: In order to make the code simple, we rewrite x * W_1 + b_1 = x' * W_1'
# where x' = [x | 1] and W_1' is the matrix W_1 appended with a new row with elements b_1's.
# Similarly, for h * W_2 + b_2
import theano
from theano import tensor as T
import numpy as np
from sklearn import datasets
@ravnoor
ravnoor / Keras.ipynb
Created April 24, 2017 02:38 — forked from prhbrt/Keras.ipynb
V-Net in Keras and tensorflow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ravnoor
ravnoor / make_mrtrix3_non_sudo.sh
Last active April 28, 2018 18:07
Build MRtrix3 without root
# tested on silius with conda python(2.7) installed
TOOLSDIR=/host/silius/local_raid/ravnoor/00_toolbox
conda install libgcc
######################################################
# build and install gcc > 4.8 (c++ 11 support)
wget http://ca.mirror.babylon.network/gcc/releases/gcc-4.9.4/gcc-4.9.4.tar.gz
tar xzf gcc-4.9.4.tar.gz
@ravnoor
ravnoor / _verify-repair-permissions-disk.md
Created February 11, 2017 17:16 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@ravnoor
ravnoor / pubmed_ask.r
Created August 11, 2016 23:15 — forked from briatte/pubmed_ask.r
pubmed scraper
#' Get a PubMed search index
#' @param query a PubMed search string
#' @return the XML declaration of the search
#' @example
#' # Which articles discuss the WHO FCTC?
#' pubmed_ask("FCTC OR 'Framework Convention on Tobacco Control'")
pubmed_ask <- function(query) {
# change spaces to + and single-quotes to URL-friendly %22 in query
query = gsub("'", "%22", gsub(" ", "+", query))

Keybase proof

I hereby claim:

  • I am ravnoor on github.
  • I am ravnoor (https://keybase.io/ravnoor) on keybase.
  • I have a public key ASDfW4iPgbNsyHxffEVzAoml6Nn1kNtYjukuXw3hQL7QUgo

To claim this, I am signing this object:

@ravnoor
ravnoor / eps2tiff.sh
Last active January 31, 2016 23:39
Convert EPS to TIFF with LZW compression
#!/bin/bash
# Convert EPS to TIFF using GraphicsMagick
DIR="$( pwd )"
`unalias gm` # gm is aliased to gitmerge in OSX 10.11.3 with Homebrew
find "$DIR" -iname "*.eps" | sed 's/^.\///g' | while read EPS
do
echo "converting to TIFF ($i)"
TIFF=`echo "$EPS" | sed "s/.eps$/.tiff/"`
@ravnoor
ravnoor / prepare_images
Created January 31, 2016 23:31 — forked from xpac27/prepare_images
Prepare images for Francoiscogne.com's backoffice
#!/bin/bash
# Requires: brew install imagemagick --with-little-cms --with-little-cms2
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo ""
echo ""
echo ""
echo ""
echo "All the images in the following folder will be changes: "
@ravnoor
ravnoor / openvpn-connect.sh
Created January 29, 2016 03:48
Switch VPN servers on openWRT
#!/bin/sh
display_usage() {
echo "Usage:"
echo " ovpn.sh <server-prefix>"
echo " ovpn.sh ca"
echo " server examples: ca, us, ca1, ca2 ..."
}
if [ $# -le 0 ]; then
#!/bin/tcsh
#flip monitor left to right in dual-monitor configuration
xrandr --output VGA-0 --right-of DVI-I-1