- lxml - Pythonic binding for the C libraries libxml2 and libxslt.
- boto - Python interface to Amazon Web Services
- Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
- Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
- PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
- Celery - Task queue to distribute work across threads or machines.
- pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.
This file contains 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
@codecs = { | |
"flv"=>"-codec:v libx264 -crf 19", | |
"mov"=>"-c:v copy -c:a h264 -acodec aac -strict -2", | |
"avi"=>"-c:v copy -c:a libmp3lame -q:a 2", | |
# this is left to be done | |
"mp4"=>"-c:v copy -b:a 192k -c:a aac -strict -2", | |
"wmv"=>"-codec:v libx264 -crf 23 -c:a libfaac -q:a 100" |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
This file contains 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
# Okay lets first implement the base cases and then we can tackle higher numbers | |
# First we need to have the condition thats stops the sequence, i.e when n is 1 | |
while(n != 1) do | |
# the sequence here | |
end | |
# Now for the rules to be implemented | |
# n → n/2 (n is even) | |
# n → 3n + 1 (n is odd) |
This file contains 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
public Tournament getOngoingTournament() { | |
Tournament tournament = null; | |
SQLiteDatabase db = this.getReadableDatabase(); | |
String sql = "SELECT " | |
+ COLUMN_TOURNAMENT_ID + "," | |
+ COLUMN_STATUS + "," | |
+ COLUMN_FIRST_USER + "," | |
+ COLUMN_FIRST_PRIZE + "," | |
+ COLUMN_SECOND_USER + "," |
This file contains 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
2 ways to extract elements from within XML namespaces using Nokogiri | |
When trying to select elemenets in the default namespace, e.g. "xmlns= http://www.w3.org/2005/Atom", try the following two ways. Note the xmlns=" attribute on entry element: | |
Original xml: | |
Nokogiri::XML(@xml_string).xpath("//author/name").each do |node| | |
puts node | |
end | |
1. Define a namespace context for your XPath expression and point your XPath steps to match elements in that namespace. Define a namespace-to-prefix mapping and use this prefix (a) in the XPath expression. |
Edit: I've done the same process every couple years since 2013 (Mountain Lion, Mavericks and High Sierra).
I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).
I kinda regret for not using Boxen to automate the process, but TBH I have this laptop for almost 3yrs and this is the first
OlderNewer