Skip to content

Instantly share code, notes, and snippets.

View arunenigma's full-sized avatar

Shan arunenigma

  • Silicon Valley
View GitHub Profile
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# Written by Brendan O'Connor, brenocon@gmail.com, www.anyall.org
# * Originally written Aug. 2005
# * Posted to gist.github.com/16173 on Oct. 2008
# Copyright (c) 2003-2006 Open Source Applications Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
<?php
/**
* A simple Facebook PHP example.
*
* - This is not a "Facebook SDK".
* - This example uses Curl, Hash, JSON, Session extensions.
* - This does not use the JavaScript SDK, nor the cookie set by it.
* - This works with Canvas, Page Tabs with IFrames, the Registration Plugin
* and with any other flow which uses the signed_request.
# -*- coding: utf-8 -*-
"""
LICENSE: BSD (same as pandas)
example use of pandas with oracle mysql postgresql sqlite
- updated 9/18/2012 with better column name handling; couple of bug fixes.
- used ~20 times for various ETL jobs. Mostly MySQL, but some Oracle.
to do:
save/restore index (how to check table existence? just do select count(*)?),
finish odbc,
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
@arunenigma
arunenigma / dot_not_found.txt
Created January 7, 2014 06:10
Mac OSX pygraphviz program dot not found: Solution
Mac OSX pygraphviz program dot not found: Solution
This is a bug. You need to fix by editing file agraph.py of the pygraphviz package
at about line number 1240
For me file was at ___
$ mdfind agraph.py
Change
FROM:
runprog=self._get_prog(prog)
@arunenigma
arunenigma / sort_mill.py
Created December 30, 2013 02:29
Sorting a Million 32-bit integers in 2MB of RAM using Python
#!/usr/bin/env python2.7
"""
Sorting a Million 32-bit integers in 2MB of RAM using Python
Inspired by the Master himself!
"""
import array
import heapq
import random
import struct
@arunenigma
arunenigma / block_web.c
Created December 29, 2013 06:34
How to block websites using C code
#include
#include
#include
char site_list[6][30]={
“google.com”,
“www.google.com”,
“youtube.com”,
“www.youtube.com”,
“yahoo.com”,
@arunenigma
arunenigma / pyc2py.tex
Created December 18, 2013 04:15
pyc to py
cd into uncompyle2 project folder
$python setup.py install
after installation
$python /Users/arunprasathshankar/Downloads/uncompyle2-master/scripts/uncompyle2 <.pyc file path>
@arunenigma
arunenigma / colorball.tex
Created November 10, 2013 19:14
Color Ball in LaTex
\documentclass[pstricks,dvipsnames,cmyk]{standalone}
\usepackage{etoolbox}
\def\temp{}
\begingroup
\renewcommand\DefineNamedColor[4]{\listgadd{\temp}{#2}}
\input{dvipsnam.def}
\endgroup