Skip to content

Instantly share code, notes, and snippets.

@omarish
omarish / uninstall_vmware_fusion.sh
Created November 5, 2012 19:28
Uninstall Vmware Fusion 5.0 on OSX. Restart your machine when you're done!
#!/bin/sh
# Instruction from http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017838
sudo rm -rf "/Library/Application Support/VMware"
sudo rm -rf "/Library/Application Support/VMware Fusion"
sudo rm -rf "/Library/Preferences/VMware Fusion"
sudo rm -rf "/Applications/VMware Fusion.app"
rm -rf "~/Library/Application Support/VMware Fusion"
rm -rf "~/Library/Caches/com.vmware.fusion"
15199734 95137668395 1236789689135 95137668395 894102
138449190 13 4123 13 547230
1799839470 12903 106398138 12903 3650790
7113990 13 107198 13 105872910
167739 19002830 5596333435 19002830 9867
#
# Urls
#
from django.conf.urls.defaults import patterns, url, include
from django.contrib import admin
from tastypie.api import Api
from resources import UserResource, FollowResource, FollowItemResource
{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 16}, "objects": [{"deleted_at": null, "followed_at": "2012-08-06T14:04:00.148184", "id": "20", "last_check": "2012-08-07T16:46:40.024772", "lat": null, "lng": null, "max_distance": null, "name": "2007 Audi RS4", "resource_uri": ""},
...
]
@omarish
omarish / gist:3080200
Created July 10, 2012 00:42
Priceonomics Puzzles

Priceonomics Programming Puzzle, Summer 2012

We love solving puzzles at Priceonomics. We also like meeting people who like to solve puzzles. Here are two interesting puzzles we've faced at some point in the past months that we'd like to share with you.

If you have any questions, contact omar@priceonomics.com.


Puzzle 1: Heatwave

from foo.forms import MyForm
def myview(request):
form = MyForm()
if request.POST:
form = MyForm(request.POST)
if form.is_valid():
# Do something with the contents, perhaps save the form
form.save() # You can call this sometimes.
return render_to_response("success page...", {})
@omarish
omarish / es.sh
Created May 17, 2012 20:09 — forked from aaronshaf/es.sh
Install ElasticSearch 0.19.8 and AWS Cloud Plugin on Ubuntu 11.04.
cd ~
sudo apt-get update
sudo apt-get install unzip curl python-software-properties -y
#sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.8.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
@omarish
omarish / timer.py
Created January 26, 2012 22:03
Simple process timer in python.
from datetime import datetime
import time
class timer:
def __enter__(self):
self.start = datetime.now()
return self
def __exit__(self, type, value, traceback):
self.end = datetime.now()
#!/usr/bin/env python
import random
import string
import operator
from collections import defaultdict
class Client:
def __init__(self, body=None):
""" Initialize a client. An optional body can be passed as ``body``,
otherwise a random string with 100 letters will be created. """
#!/usr/bin/env python
A1 = 'd64a84456adc959f56de6af685d0dadd' # "hard", according to google
B1 = '8d8a1b73876ca678cc3afa372e5199de'
import hashlib
m = hashlib.md5()
m.update('problems')
B2 = m.hexdigest()
print B2 == B1