Skip to content

Instantly share code, notes, and snippets.

@kpykc
kpykc / fontawesome.sty
Last active August 29, 2015 14:27 — forked from sway/fontawesome.sty
FontAwesome mapping for XeLaTeX
% FontAwesome (http://fortawesome.github.com/Font-Awesome/) bindings for (Xe)LaTeX
% Author: Honza Ustohal <[email protected]>
%
% Translation of FontAwesome's private range characters into XeTeX symbols. All icons are camel-cased and prefixed with 'fa', i.e. what was .icon-align-center the CSS version of FontAwesome becomes \faAlignCenter
% This might be reworked into a full blown package in the near future
%
% Prerequisite:
% XeLaTeX, FontAwesome installed as a system font accessible by XeLaTeX
%
% Usage:
@kpykc
kpykc / write_png_to_memory_with_libpng.cpp
Last active August 30, 2015 03:53 — forked from dobrokot/write_png_to_memory_with_libpng.cpp
encode and write PNG to memory (std::vector) with libpng on C++
#include <png.h>
#include <vector>
#include <iostream>
#include <stdlib.h>
//encode and write PNG to memory (std::vector) with libpng on C++
typedef unsigned char ui8;
#define ASSERT_EX(cond, error_message) do { if (!(cond)) { std::cerr << error_message; exit(1);} } while(0)
@kpykc
kpykc / notify.R
Last active August 31, 2015 22:20 — forked from hrbrmstr/notify.R
Send OS X notifications from R (RStudio, R GUI or R console)
notify <- function(msg="Operation complete") {
in.osx <- (Sys.info()['sysname'] == "Darwin")
in.rstudio <- (Sys.getenv("RSTUDIO") == "1")
in.rgui <- (Sys.getenv("R_GUI_APP_REVISION") != "")
if (in.rstudio) { # hack to see if running in RStudio
title <- "RStudio"
sender <- activate <- "org.rstudio.RStudio"
}

Setup lisp with slime on OS X

Install your favorite lisp interpreter

If you already have Homebrew, just open a terminal and type

$ brew install clozure-cl
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kpykc
kpykc / Ruse IPython Notebook
Created November 19, 2015 05:32 — forked from kapadia/Ruse IPython Notebook
WebGL plotting in IPython Notebook
{
"metadata": {
"name": "Ruse Integration"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@kpykc
kpykc / Dockerfile
Created November 21, 2015 13:23
Jupyter Notebook with CUDA accelerated Theano and Keras all in a Docker container
# Docker container that spins up a Jupyter notebook server
# with CUDA accelerated Theano support. Assumes the host
# system has CUDA drivers installed that match the version below.
#
# Launch with a comman line similar to the following:
#
# docker run -it \
# --device /dev/nvidiactl --device /dev/nvidia-uvm --device /dev/nvidia0
# -p 8888:8888
# -v /[where notebooks are on your local machine]:/notebooks
@kpykc
kpykc / ipython-notebook.conf
Last active November 22, 2015 17:27 — forked from whophil/ipython-notebook.conf
Upstart file (Ubuntu) for Jupyter / IPython notebook
# To be placed in /etc/init/ with 644 permissions
start on filesystem or runlevel [2345]
stop on shutdown
description "Jupyter / IPython Notebook Upstart script for Jetson TK-1"
script
export HOME="/home/ubuntu"; cd $HOME
export PATH=/usr/local/cuda-6.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib:$LD_LIBRARY_PATH
@kpykc
kpykc / ipython-nbserver.py
Created November 22, 2015 20:56 — forked from samklr/ipython-nbserver.py
Install Ipython Notebook on a VM and Launch it as a server in a Cloud Platform. Here, in Google Compute Engine.
##### Install a lot of stuff first #####
$sudo apt-get update
##install python
$ wget http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/Anaconda-2.0.1-Linux-x86_64.sh
$ sudo bash anaconda........sh
##install necessary libs
$ sudo apt-get install -y python-matplotlib python-tornado ipython ipython-notebook python-setuptools python-pip
import zmq
import time
from multiprocessing import Process
import numpy as np
np.set_printoptions(precision=3)
def send_array(socket, A, flags=0, copy=True, track=False):
"""send a numpy array with metadata"""
md = dict(dtype=str(A.dtype), shape=A.shape)