Skip to content

Instantly share code, notes, and snippets.

View ivikash's full-sized avatar

Vikash Agrawal ivikash

View GitHub Profile
ok
doctest (test_zipped_doctest) ... 1 tests with zero failures
Finding tests in test_zipped_doctest.sample_func
Trying:
print(sample_func(22))
Expecting:
44
ok
doctest (test_zipped_doctest) ... 1 tests with zero failures
Finding tests in test_zipped_doctest.test_DocTest
#include <stdio.h>
/* count digits, white space, others */
main()
{
int c, i, nwhite, nother;
int ndigit[10];
nwhite = nother = 0;
for (i = 0; i < 10; ++i)
ndigit[i] = 0;
while ((c = getchar()) != EOF)
#include <stdio.h>
/* count digits, white space, others */
int main()
{
int c, i, nwhite, nother;
int ndigit[10];
nwhite = nother = 0;
for (i = 0; i < 10; ++i)
ndigit[i] = 0;
while ((c = getchar()) != EOF)
@ivikash
ivikash / hwinfo --gfxcard
Created December 29, 2011 04:25
graphics information
localhost:/home/vikash # hwinfo --gfxcard
09: PCI 02.0: 0300 VGA compatible controller (VGA)
[Created at pci.319]
Unique ID: _Znp.j5duo6BuBmF
SysFS ID: /devices/pci0000:00/0000:00:02.0
SysFS BusID: 0000:00:02.0
Hardware Class: graphics card
Model: "Intel Mobile 4 Series Chipset Integrated Graphics Controller"
Vendor: pci 0x8086 "Intel Corporation"
Device: pci 0x2a42 "Mobile 4 Series Chipset Integrated Graphics Controller"
@ivikash
ivikash / Debugging Ruby Notes.html
Created March 19, 2012 17:56 — forked from daya/Debugging Ruby Notes.html
My notes from Aman Gupta's Debugging Ruby webinar by Engine Yard
<a href="http://en.wikipedia.org/wiki/Lsof">lsof</a>
----
show open files
lsof -nPp <pid>
<a href="http://linux.die.net/man/1/strace">strace</a>
------
@ivikash
ivikash / swInstallable
Created April 7, 2012 08:05
S/W to be installed on Mac
[ This is a rough draft ]
[Thanks Branes and Xeon3d ]
[ Get proxy settings changed ]
[ $100 to download various useful apps from Appstore]
Links to look for
http://www.makeuseof.com/tag/15-musthave-free-apps-mac/
http://www.macstories.net/roundups/my-must-have-25-mac-apps/
http://paid.musthavemacapps.com/
@ivikash
ivikash / Auto-Commiter
Created June 1, 2012 13:43
To Auto Commit my IRC logs, privately at github
#!/usr/bin/python
import datetime
import subprocess
import sys
import os
class Commit(object):
def __init__(self, repo):
"""Initialization
@ivikash
ivikash / stickfigure.html
Created June 6, 2012 14:24
Stick Figure in HTML
<!DOCTYPE html><!-- Author: Vikash Agrawal <vikashagrawal1990@gmail.com --><html><head>
<title>Stickfigure</title>
<style>
#BodyX
{
width: auto;
height: 200px;
display: block;
padding: 30px;
-moz-transition: -moz-transform 2s;
@ivikash
ivikash / flask101.py
Created June 30, 2012 20:52
Testing Flask
from flask import Flask, url_for
app = Flask(__name__)
@app.route('/')
def index():
url_for('hello_world')
return 'Index Page'
@app.route('/hello')
@ivikash
ivikash / parser101.py
Created August 12, 2012 09:36
A file parser to generate posting lists
# Pass file-names as command line arguments.
# say python parser foo.txt bar.txt baz.txt
#self.id for foo.txt = 1, bar.txt = 2, baz.txt = 3
import re
import sys
import hashlib
from collections import defaultdict
class Parser(object):
def __init__(self, *args):