Skip to content

Instantly share code, notes, and snippets.

@offmessage
offmessage / copydatabase.sh
Created February 9, 2012 11:56
Copy a postgres database on the same machine
# old database must be idle (no held open connections or write transactions)
sudo -u postgres createdb newdatabase -T olddatabase
@ndarville
ndarville / business-models.md
Last active October 23, 2024 17:18
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
@jbenet
jbenet / simple-git-branching-model.md
Last active November 9, 2024 04:55
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@donis
donis / en_to_native_countries
Created April 2, 2015 16:28
English to native country names
country,native_name
Afghanistan,افغانستان
Albania,Shqipëria
Algeria,الجزائر
American Samoa,Amerika Sāmoa
Andorra,Andorra
Angola,Angola
Anguilla,Anguilla
Antigua and Barbuda,Antigua and Barbuda
Argentina,Argentina