Skip to content

Instantly share code, notes, and snippets.

Alvaro Muir alvaromuir

Block or report user

Report or block alvaromuir

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alvaromuir
alvaromuir / tensorflow_gpu_macos.txt
Created Dec 13, 2017
TensorFlow GPU 1.2+ on MacOS Sierra
View tensorflow_gpu_macos.txt
# Xcode 8, cudnn 6.1, cuda 8.0,
# bazel 0.5.4, tensorflow r1.3
# takes about 36 min on macbook pro 2.8Ghz, 8GB RAM
# edit *tensorflow/third_party/gpus/cuda/BUILD.tpl*
# [#comment out] linkopts = [“-lgomp”]
$ export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/extras/CUPTI/lib
$ export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH\nexport PATH=$DYLD_LIBRARY_PATH:$PATH \
export flags="--config=cuda --config=opt"
$ export CUDA_HOME=/usr/local/cuda
@alvaromuir
alvaromuir / connstat
Created Jan 28, 2017
Get connection status of supplied domain
View connstat
netstat -nat | grep `nslookup {DOMAIN} | awk '/Address/ ' | sed 's/^.*Address: //p' | tail -1` | awk '{print $6}' | sort | uniq -c | sort -n
View .profile
PS1="\n\u@\h: \[\e[1;36m\]\w\n\[\e[1;32m\]=> \[\e[0m\]"
alias ls='ls -G'
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
export DOCKER_HOST=tcp://192.168.59.103:2376
View economet
#!/bin/python3
"""
returns possible combinatations in a list
"""
def combo(n,k):
import itertools
return list(itertools.combinations(list(range((n-(n-1)),(n+1))),k))
@alvaromuir
alvaromuir / rPackages.r
Last active Jan 15, 2016
R Setup packages
View rPackages.r
# $ brew install unixodbc on mac
install.packages("devtools")
devtools::install_github("selva86/InformationValue")
install.packages(c("RODBC","RPostgreSQL","RSQLite","RMySQL",
"xlsx","XLConnect","foreign",
"dplyr","tidyr","stringr","lubridate","reshape",
"ggplot2","ggvis","rgl","htmlwidgets","googleVis","RColorBrewer",
@alvaromuir
alvaromuir / gist:8492876
Created Jan 18, 2014
Social Web App idea #MLKDreamCode
View gist:8492876
Yelp meets kickstarter for social good.
People should be able to post information and images about things they want to change in their community.
Requires social login to ensure the word is spread
Gamaified by karma points.
Gains attention of local governing bodies, community members, neighbors
@alvaromuir
alvaromuir / obj-c_marcos
Created Jan 5, 2014
Some common Objective-C Macros
View obj-c_marcos
#define PI 3.141592654
#define TWO_PI 2.0 * PI
#define SQUARE(x) ((x)*(x))
#define CUBE(x) ((x)*(x)*(x))
#define IS_LEAP_YEAR(y) y % 4 == 0 && y % 100 != 0 || y % 400 == 0
#define IS_LOWER_CASE(x) ( ((x) >= 'a') && ((x) <= 'z'))
#define TO_UPPER(x) (IS_LOWER_CASE(x) ? (x) - 'a' + 'A': (x))
#define INCHES_PER_CENT 0.394
#define CENT_PER_INCH (1/INCHES_PER_CENT)
View snippets
// Remove timestamp from NSLog
#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
@alvaromuir
alvaromuir / Ordinals.py
Last active Dec 30, 2015
Python Ordinals
View Ordinals.py
def ordinal(n):
if 4 <= n <= 20 or 24 <= n <= 30:
return n + 'th'
else:
return str(n) + ["st", "nd", "rd"][n % 10 - 1]
View _custom.scss
// Colors:
$TURQUOISE: #1abc9c;
$GREENSEA: #16a085;
$EMERALD: #2ecc71;
$NEPHRITIS: #27ae60;
$PETERRIVER: #3498db;
$BELIZEHOLE: #2980b9;
$AMERGYST: #9b59b6;
$WISTERIA: #8e44ad;
$WETASPHALT: #34495e;
You can’t perform that action at this time.