Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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:6575133
Created September 15, 2013 23:15
Lol Scala.
Zameers-MacBook-Air:~ zmanji$ scala
Welcome to Scala version 2.10.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_17).
Type in expressions to have them evaluated.
Type :help for more information.
scala> null == null.asInstanceOf[Int]
<console>:8: warning: comparing values of types Null and Int using `==' will always yield false
null == null.asInstanceOf[Int]
^
res0: Boolean = true
Crashlog created at 2012-10-10 20:48:42 -0400
=== MESSAGE:
NoMethodError: undefined method `synchronize' for nil:NilClass
=== COMPILATION STACK:
- [item] /resume/ (rep default)
@zmanji
zmanji / sp.c
Created September 13, 2012 19:03
Printing the SP on x86_64
/* Tested on OSX with GCC 4.7 */
#include <stdint.h>
#include <stdio.h>
int main() {
uint64_t sp = 0;
asm("movq %%rsp,%0" : "=r"(sp));
printf("%016llX\n", sp);
return 0;
@zmanji
zmanji / __phutil_library_init__.php
Created July 25, 2012 21:55
Phabricator Event Development
<?php
phutil_register_library('disqus', __FILE__);
@zmanji
zmanji / gist:2554720
Created April 30, 2012 01:32
CMakeCache
# This is the CMakeCache file.
# For build in directory: /tmp/homebrew-weechat-0.3.7-C0HR/weechat-0.3.7
# It was generated by CMake: /usr/local/Cellar/cmake/2.8.8/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
# This is the CMakeCache file.
# For build in directory: /tmp/homebrew-weechat-0.3.7-H1kz/weechat-0.3.7
# It was generated by CMake: /usr/local/Cellar/cmake/2.8.8/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
/usr/bin/curl -qf#LA Homebrew 0.9 (Ruby 1.8.7-249; Mac OS X 10.7.3) https://raw.github.com/2bits/homebrew/fixWeechat/Library/Formula/weechat.rb -o /Users/zmanji/Library/Caches/Homebrew/Formula/weechat.rb --silent
==> 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 -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/weechat/0.3.7' -DCMAKE_BUILD_TYPE=None -Wno-dev -DPREFIX=/usr/local/Cellar/weechat/0.3.7 -DENABLE_PERL=OFF -DENABLE_PYTHON=OFF .
cmake -DCMAKE_INSTALL_PREFIX='/usr/local/Cellar/weechat/0.3.7' -DCMAKE_BUILD_TYPE=None -Wno-dev -DPREFIX=/usr/local/Cellar/weechat/0.3.7 -DENABLE_PERL=OFF -DENABLE_PYTHON=OFF .
Re-run cmake no build system arguments
-- 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