This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#have homebrew install postgres 9... I did this accidentally so this command may or may not work | |
brew install postgres | |
#dump all DBs | |
/usr/local/Cellar/postgresql/8.4.4/bin/pg_dumpall -p 5432 > postgres8.4.backup.sql | |
#stop postgres 8.4 | |
launchctl unload -w Library/LaunchAgents/org.postgresql.postgres.plist | |
#backup its data to a new dir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An Open Letter to Apple | |
by Richard Ziade on Feb 21, 2011 (0) Comments | |
Dear Apple: | |
It’s your friends from Readability. Remember us? You put our technology into your Safari browser last year. We’re writing this open letter because – well – we’re a little upset right now. | |
Last Friday, you notified us that our Readability iOS application was rejected. In explaining the rejection, you pointed us to 11.2 in the App Store Review Guidelines: | |
11.2 Apps utilizing a system other than the In App Purchase API (IAP) to purchase content, functionality, or services in an app will be rejected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(a=1; a<size; a++) | |
for(b=size-1; b>=a; b--) { | |
if(nums[b-1] > nums[b]) { // if out of order | |
// exchange elements | |
t = nums[b-1]; | |
nums[b-1] = nums[b]; | |
nums[b] = t; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
int main() | |
{ | |
//let's init some vars | |
double num1 = 0; | |
double num2 = 0; | |
double sum = 0; | |
char add; //define a random value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function commitProperties():void | |
{ | |
if (dirtyDataFlag && data && data.name.search(/[^a-z ]/i > -1)) | |
{ | |
foo(data); | |
if(email) | |
{ | |
bar(data); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"tab autocompletes | |
function! InsertTabWrapper() | |
let col = col('.') - 1 | |
if !col || getline('.')[col - 1] !~ '\k' | |
return "\<tab>" | |
else | |
return "\<c-p>" | |
endif | |
endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib, re | |
from pprint import pprint as pp | |
from datetime import datetime, timedelta | |
from geopy.geocoders import Google | |
import MySQLdb | |
from time import sleep | |
bcpd_arc_url = "http://maps.baltimorepolice.org/servlet/com.esri.esrimap.Esrimap?ServiceName=BaltimorePolice&CustomService=Query&ClientVersion=3.1&Form=True&Encode=False" | |
districts={"Northwest": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#a very simple serialization | |
def _serialize(model_instance): | |
#the defaultdict returns an identity function by default | |
types = defaultdict(lambda: lambda x: x) | |
types[datetime] = lambda x: unicode(x) | |
r = {} | |
for f in model_instance._meta.fields: | |
attval = getattr(model_instance, f.attname) | |
#serialize the type if it needs serialization |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<div id="plugins"></div> | |
<!--<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" id="vlc" hidden="true" autoplay="off" />--> | |
<!--<embed type="application/x-mplayer2" id="mediaPlayer" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" autostart="false" width="320" height="240" />--> | |
<script type="text/javascript" src="scripts/repository.js"></script> | |
<script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request URL:http://localhost:3000/map/polys | |
Request Method:POST | |
Status Code:200 OK | |
Request Headers | |
Accept:text/javascript, text/html, application/xml, text/xml, */* | |
Content-type:application/json; charset=UTF-8 | |
Origin:http://localhost:3000 | |
Referer:http://localhost:3000/map | |
User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.9 (KHTML, like Gecko) Chrome/6.0.401.1 Safari/533.9 | |
X-Prototype-Version:1.6.0.3 |