Skip to content

Instantly share code, notes, and snippets.

View dyndna's full-sized avatar
💤
Moved to @sbamin

Samir B. Amin dyndna

💤
Moved to @sbamin
View GitHub Profile
@dyndna
dyndna / get_oauth2_token.py
Last active April 28, 2016 19:37 — forked from burnash/get_oauth2_token.py
Simple command line script to fetch a Google API's access token.
'''
This script will attempt to open your webbrowser,
perform OAuth 2 authentication and print your access token.
It depends on two libraries: oauth2client and gflags.
To install dependencies from PyPI:
$ pip install python-gflags oauth2client
@dyndna
dyndna / parse-options.sh
Created April 24, 2016 23:45 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@dyndna
dyndna / tensorflow_in_r_using_rpython.R
Created March 24, 2016 20:28 — forked from rasmusab/tensorflow_in_r_using_rpython.R
An example of building a TensorFlow model from R using rPython
### An example of building a TensorFlow model from R using rPython ###
# For this script you need to
# 1. Have python 2.7 installed.
# 2. Install the rPython package in R.
# 3. Install Google's TensorFlow library as per these instructions:
# http://www.tensorflow.org/get_started/os_setup.md#binary_installation
### Here is how to setup and run a trivial TensorFlow model ###
# Load TensorFlow (I couldn't get this to work without setting sys.argv... )