Skip to content

Instantly share code, notes, and snippets.

View waqasjamal-zz's full-sized avatar

Waqas Jamal waqasjamal-zz

View GitHub Profile
@blammothyst
blammothyst / LPTHWex25
Created February 27, 2014 20:20
Code from Learn Python The Hard Way (.org) ex 25
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
def sort_words(words):
"""Sorts the words."""
return sorted(words)
def print_first_word(words):
@blammothyst
blammothyst / LPTHWex26
Created February 27, 2014 20:19
Code from Learn Python The Hard Way (.org) ex 26
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')
return words
def sort_words(words):
"""Sorts the words."""
return sorted(words)
def print_first_word(words):
@blammothyst
blammothyst / LPTHWex32
Last active August 29, 2015 13:56
Code from Learn Python The Hard Way (.org) ex 32
the_count = [1, 2, 3, 4, 5]
fruits = ['apples', 'oranges', 'pears', 'apricots']
change = [1, 'pennies', 2, 'dimes', 3, 'quarters']
#this first kind of for-loop goes through a list
for number in the_count:
print "This is count %d" % number
#same as above
for fruit in fruits:
@l0b0
l0b0 / update-wordpress.sh
Created February 6, 2012 22:13
WordPress update script
#!/bin/sh
#
# $Id: update-wordpress.sh 393 2008-06-19 10:29:18Z vengmark $
#
# NAME
# update-wordpress.sh - Update WordPress to latest stable version.
#
# SYNOPSIS
# update-wordpress.sh [options]
#