Skip to content

Instantly share code, notes, and snippets.

View sumeet's full-sized avatar

Sumeet Agarwal sumeet

  • San Francisco, CA
View GitHub Profile
@sumeet
sumeet / .minttyrc
Created October 20, 2014 04:57
mitsuhiko colors for mintty
BoldAsFont=yes
Font=monofur
FontHeight=14
FontSmoothing=full
AllowBlinking=yes
Locale=en_US
Charset=UTF-8
Scrollbar=none
FontIsBold=no
#!/usr/bin/env python
import pygments
import re
import sys
from pygments.lexers import RubyLexer
from pygments.formatters import TerminalFormatter
Traceback (most recent call last):
File "blah.py", line 3, in <module>
requests.get("FUCK")
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/sessions.py", line 422, in request
prep = self.prepare_request(req)
File "/Library/Python/2.7/site-packages/requests-2.3.0-py2.7.egg/requests/sessions.py", line 360, in prepare_request
describe "blah" do
let(:blah) { 123 }
it "blah" do
self.class.let(:blah) { 234 }
blah.should == 234
end
end
[0] % yes | head -n 20 | parallel cat
When using programs that use GNU Parallel to process data for publication please cite:
O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
;login: The USENIX Magazine, February 2011:42-47.
This helps funding further development; and it won't cost you a cent.
Or you can get GNU Parallel without this requirement by paying 10000 EUR.
To silence this citation notice run 'parallel --bibtex' once or use '--no-notice'.
require "json"
require "yaml"
cassette_files = `git ls-files features/cassettes spec/vcr_cassettes | grep yml$`.split
p cassette_files
cassette_files.each do |filename|
yaml = YAML.load_file filename
yaml.fetch("http_interactions").each do |interaction|
" Remove extra whitespace before saving
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s

Keybase proof

I hereby claim:

  • I am sumeet on github.
  • I am sumeet (https://keybase.io/sumeet) on keybase.
  • I have a public key whose fingerprint is 22C7 9A11 F52D B307 E0E1 4B4B 0447 BEBE DD4D CCC4

To claim this, I am signing this object:

@sumeet
sumeet / hello_timer.py
Created June 1, 2010 05:58
An artie timer example.
from artie.applications import timer
@timer(10)
def hi(irc):
"""
Sends a message to every channel the bot is in every 10 seconds.
"""
for channel in irc.channels:
irc.msg(channel, 'hi i am artie')
@sumeet
sumeet / find.py
Created July 11, 2010 17:47
Python find
import os
import re
def find(expression, path='.', type='df'):
"""
Find files or directories.
>>> list(find(r'.*\.py$', type='f'))
['./find.py']
"""