Skip to content

Instantly share code, notes, and snippets.

@eyliu
eyliu / matlab.tex
Created May 31, 2009 00:34
LaTeX settings for MATLAB code listings
% LaTeX settings for MATLAB code listings
% based on Ted Pavlic's settings in http://links.tedpavlic.com/ascii/homework_new_tex.ascii
\usepackage{listings}
\usepackage[usenames,dvipsnames]{color}
% This is the color used for MATLAB comments below
\definecolor{MyDarkGreen}{rgb}{0.0,0.4,0.0}
% For faster processing, load Matlab syntax for listings
\lstloadlanguages{Matlab}%
@eyliu
eyliu / constitution.cls
Created August 11, 2009 20:05
LaTeX document class for typesetting a constitution
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesClass{constitution}[2009/05/15 v0.0.1 Document class for typesetting a constitution]
\LoadClass{report}
\RequirePackage[letterpaper,margin=1in]{geometry}
\RequirePackage[colorlinks,linkcolor=blue]{hyperref}
%\usepackage{hyperref}
\RequirePackage{titlesec}
@eyliu
eyliu / harminv.rb
Created July 26, 2011 19:49
Homebrew formula for Harminv
require 'formula'
class Harminv < Formula
url 'http://ab-initio.mit.edu/harminv/harminv-1.3.1.tar.gz'
homepage 'http://ab-initio.mit.edu/wiki/index.php/Harminv'
md5 'd3f49f1c90856b3b2e8b77dc4a99c37a'
def install
ENV.fortran
system "./configure", "--disable-debug", "--disable-dependency-tracking",
# Source: http://code.google.com/apis/gdata/articles/python_client_lib.html
import gdata.docs.service
import getpass
# Create a client class which will make HTTP requests with Google Docs server.
client = gdata.docs.service.DocsService()
# Authenticate using your Google Docs email address and password.
username = raw_input('Google Account (e.g. user@gmail.com): ')
password = getpass.getpass("%s's password: " % username)
@eyliu
eyliu / grace.rb
Created August 31, 2011 12:04
Homebrew formula for grace
require 'formula'
class Grace < Formula
url 'ftp://plasma-gate.weizmann.ac.il/pub/grace/src/stable/grace-5.1.22.tar.gz'
homepage 'http://plasma-gate.weizmann.ac.il/Grace/'
md5 '672356466f18fe59ed21a8fb44f9851d'
depends_on 'lesstif'
def patches
@eyliu
eyliu / machine_cfg.py
Created August 29, 2011 16:18
Configuration for RODIS for Mac OS X with dependencies provided by Homebrew
# Configuration file for RODIS:
# http://photonics.intec.ugent.be/research/facilities/design/rodis/default.htm
#
# Based on the configuration file for Ubuntu Linux:
# http://photonics.intec.ugent.be/research/facilities/design/rodis/setup-ubuntu-hardy-
# howto.txt
#
# Boost.Python provided by Homebrew: http://mxcl.github.com/homebrew/
cc = "gcc"
cxx = "g++"
#!/usr/bin/env python
# coding: utf-8
# Reproduces Fig. 2 in Moharam, Grann, Pommet, and Gaylord, "Formulation for stable and
# efficient implementation of the rigorous coupled-wave analysis of binary gratings",
# J. Opt. Soc. Am. A 12(5), pp. 1068–1076, 1995 (doi:10.1364/JOSAA.12.001068)
import rodis
from math import pi
import numpy
import pylab
@eyliu
eyliu / machine_cfg.py
Created August 15, 2011 18:43
Configuration for CAMFR on Mac OS X Lion (dependencies from Homebrew and SciPy Superpack)
# This Python script contains all the machine dependent settings
# needed during the build process.
# Compilers to be used.
cc = "/usr/bin/gcc-4.2"
cxx = "/usr/bin/g++-4.2"
f77 = "/usr/local/bin/gfortran"
link = cxx
@eyliu
eyliu / h5utils.rb
Created July 27, 2011 15:24
Homebrew formula for h5utils
require 'formula'
class H5utils < Formula
url 'http://ab-initio.mit.edu/h5utils/h5utils-1.12.1.tar.gz'
homepage 'http://ab-initio.mit.edu/wiki/index.php/H5utils'
md5 '46a6869fee6e6bf87fbba9ab8a99930e'
depends_on 'hdf5'
def install
@eyliu
eyliu / meep.rb
Created July 27, 2011 15:49
Homebrew formula for MEEP
require 'formula'
class Meep < Formula
url 'http://ab-initio.mit.edu/meep/meep-1.1.1.tar.gz'
homepage 'http://ab-initio.mit.edu/wiki/index.php/Meep'
md5 '415e0cd312b6caa22b5dd612490e1ccf'
depends_on 'harminv'
depends_on 'libctl'
depends_on 'hdf5'