Skip to content

Instantly share code, notes, and snippets.

@marvin
marvin / prototype_mysqldump_zip_enc_to_couchdb.py
Created November 24, 2012 21:39
quick prototype in python for taking a mysqldump, zip and encrypt it and store in couchdb
import couchdb
import random
import string
from beefish import encrypt_file
from subprocess import Popen
from subprocess import PIPE
# constants
SRC_DB_USER = "root"
@pete-otaqui
pete-otaqui / bumpversion.sh
Created December 2, 2012 11:08
Bump a software project's VERSION, add the CHANGES, and tag with GIT
#!/bin/bash
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
# suggest a "minor" version update, and ask for input to use
# the suggestion, or a newly entered value.
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
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
@jcastilloa
jcastilloa / Odbc.php
Last active December 10, 2015 01:48 — forked from ceeram/Odbc.php
CakePHP 2.x DataSource ODBC · PDO · iSeriesAccess · DB2/400 (tested with V5R1). ALPHA / UNSTABLE.
<?php
/**
* ODBC for DBO. Tested with AS400 V5R1 and iSeriesAccess unixodbc
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
@impressiver
impressiver / django_bash_completion.sh
Last active December 4, 2021 18:01
Bash completion script for Django that adds tab-completion to django-admin.py and manage.py. This gist is used by the Homebrew formula `django-completion`, which you can install using: `brew install django-completion`.
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Source: https://github.com/django/django/blob/stable/1.5.x/extras/django_bash_completion
# #########################################################################
# This bash script adds tab-completion feature to django-admin.py and
# manage.py.
#
# Testing it out without installing
# =================================
#

Where people struggle learning Django

Over the last 3 years or so I've helped a bunch of companies, small and large, switch to Django. As part of that, I've done a lot of teaching Django (and Python) to people new to the platform (and language). I'd estimate I've trained something around 200-250 people so far. These aren't people new to programming — indeed, almost all of them are were currently employed as software developers — but they were new to Python, or to Django, or to web development, or all three.

In doing so, I've observed some patterns about what works and what doesn't. Many (most) of the failings have been my own pedagogical failings, but as I've honed my coursework and my skill I'm seeing, time and again, certain ways that Django makes itself difficult to certain groups of users.

This document is my attempt at organizing some notes around what ways different groups struggle. It's not particularly actionable — I'm not making any arguments about what Django should or shouldn't do (at least

@nikic
nikic / objects_arrays.md
Last active April 12, 2024 17:05
Post explaining why objects often use less memory than arrays (in PHP)

Why objects (usually) use less memory than arrays in PHP

This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)

The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array part of it away. So how does that work?

The key here is that objects usually have a predefined set of keys, whereas arrays don't:

@nicolasramy
nicolasramy / python-cs-01-installation.md
Last active August 20, 2019 07:00
My Python Cheat Sheet :- Installation- Functions- Snippets- Misc- Easter Eggs

#Python Cheat Sheet

Introduction

This is a short list of different packages to install to enhace your production in Python

pip

pip is a tool for installing and managing Python packages

@nicolasramy
nicolasramy / css-tools.md
Created July 8, 2013 13:00
Cheat sheets for PHP Quality Assurance, PHP developper tools, CSS tools... for Ubuntu 12.04+

CSS Developer tools

Requirements

NodeJS

add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
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.