Skip to content

Instantly share code, notes, and snippets.

@zmanji
zmanji / gist:745637
Created December 17, 2010 20:18
Setting up a folder and virualenv
zmanji@zmanji-VirtualBox:~$ mkdir ~/zameermanji.com
zmanji@zmanji-VirtualBox:~$ mkdir ~/.virtualenvs
zmanji@zmanji-VirtualBox:~$ mkdir ~/.virtualenvs/zameermanji.com
zmanji@zmanji-VirtualBox:~$ virtualenv ~/.virtualenvs/zameermanji.com/ --no-site-packages
New python executable in /home/zmanji/.virtualenvs/zameermanji.com/bin/python
Installing distribute.................................................................................................................................................................................done.
zmanji@zmanji-VirtualBox:~$ source ~/.virtualenvs/zameermanji.com/bin/activate
(zameermanji.com)zmanji@zmanji-VirtualBox:~$ pip install werkzeug
Downloading/unpacking werkzeug
Downloading Werkzeug-0.6.2.tar.gz (1.7Mb): 1.7Mb downloaded
Running setup.py egg_info for package werkzeug
no previously-included directories found matching 'docs/_build/doctrees'
Installing collected packages: werkzeug
Running setup.py install for werkzeug
no previously-included directories found matching 'docs/_build/doctrees'
Successfully installed werkzeug
@zmanji
zmanji / gist:745708
Created December 17, 2010 21:07
Hello World with Werkzeug
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from werkzeug import Request, Response
@Request.application
def application(request):
return Response("Hello World!")
#if I execute the script directly, it runs this on 8080
//This file implements the non restoring algorithm for division in binary
#include <stdio.h>
void binout_helper(int in, int left) {
if (left == 0) return;
binout_helper(in >> 1, left - 1);
printf("%d",in & 1);
}
@zmanji
zmanji / pygments.css
Created January 7, 2012 05:20
Solarized Pygments Dark CSS
.highlight{background-color:#073642;color:#93a1a1}.highlight .c{color:#586e75 !important;font-style:italic !important}.highlight .cm{color:#586e75 !important;font-style:italic !important}.highlight .cp{color:#586e75 !important;font-style:italic !important}.highlight .c1{color:#586e75 !important;font-style:italic !important}.highlight .cs{color:#586e75 !important;font-weight:bold !important;font-style:italic !important}.highlight .err{color:#dc322f !important;background:none !important}.highlight .k{color:#cb4b16 !important}.highlight .o{color:#93a1a1 !important;font-weight:bold !important}.highlight .p{color:#93a1a1 !important}.highlight .ow{color:#2aa198 !important;font-weight:bold !important}.highlight .gd{color:#93a1a1 !important;background-color:#372c34 !important;display:inline-block}.highlight .gd .x{color:#93a1a1 !important;background-color:#4d2d33 !important;display:inline-block}.highlight .ge{color:#93a1a1 !important;font-style:italic !important}.highlight .gr{color:#aa0000}.highlight .gh{color:#586e
@zmanji
zmanji / Makefile
Created January 10, 2012 17:00
Uwaterloo CS349 A1 Makefile
# This ensures that all of our shell commands are run with bash and not any other shell.
SHELL := /bin/bash
# This is the name of the compiler. If you have `clang` installed you can use that instead.
CXX = g++
# These are flags that are always sent to the compiler.
# -g generates debugging symbols for use in gdb and valgrind. This improves the
# output of those tools.
@zmanji
zmanji / main.c
Created March 1, 2012 06:55
Trying to get libalpm to work
#include <alpm.h>
#include <stdio.h>
int main(void)
{
enum _alpm_errno_t errno = 0;
alpm_handle_t* t = alpm_initialize("/", "/var/lib/pacman", &errno);
if(t == NULL)
@zmanji
zmanji / latex.rb
Created April 21, 2012 18:06
LaTeX filter for Nanoc
# This is a LaTeX filter for nanoc
require 'open3'
require 'fileutils'
class LatexFilter < Nanoc::Filter
identifier :latex
type :text => :binary
@zmanji
zmanji / gist:2472962
Created April 23, 2012 18:39
brew install weechat
==> Downloading http://www.weechat.org/files/src/weechat-0.3.7.tar.bz2
Already downloaded: /Users/zmanji/Library/Caches/Homebrew/weechat-0.3.7.tar.bz2
/usr/bin/tar xf /Users/zmanji/Library/Caches/Homebrew/weechat-0.3.7.tar.bz2
==> cmake -DPREFIX=/usr/local/Cellar/weechat/0.3.7 -DENABLE_RUBY=OFF -DENABLE_PERL=OFF -DENABLE_PYTHON=OFF -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/weechat/0.3.7' -DCMAKE_BUILD_TYPE=None -Wno-dev .
cmake -DPREFIX=/usr/local/Cellar/weechat/0.3.7 -DENABLE_RUBY=OFF -DENABLE_PERL=OFF -DENABLE_PYTHON=OFF -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/weechat/0.3.7' -DCMAKE_BUILD_TYPE=None -Wno-dev .
-- The C compiler identification is Clang 3.1.0
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
@zmanji
zmanji / ruby --version
Created April 24, 2012 15:26
brew --config
Zameers-MacBook-Air:~ zmanji$ brew --config
HOMEBREW_VERSION: 0.9
HEAD: fa96301b8f77ed20c76d64029422b6dfa9ec0654
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A