Skip to content

Instantly share code, notes, and snippets.

View kenju254's full-sized avatar

Kenneth Kinyanjui kenju254

View GitHub Profile
@snormore
snormore / mongotestrunner.py
Created September 21, 2012 06:23
Django, MongoDB, and MongoEngine: A custom TestRunner managing mongo test database creation and cleanup.
#coding: utf-8
from django.test.simple import DjangoTestSuiteRunner
from nose.plugins.skip import SkipTest
from mongoengine.python_support import PY3
from mongoengine import connect
try:
from django.test import TestCase
from django.conf import settings
@barnes7td
barnes7td / sublime_setup.md
Last active March 28, 2024 17:59
Sublime Terminal Setup

Setup Terminal for Sublime Shorcut "subl":

Open terminal and type:

1. Create a directory at ~/bin:

mkdir ~/bin

2. Copy sublime executable to your ~/bin directory:

@gaspanik
gaspanik / phpmyadmin.md
Created September 30, 2012 14:49
Install: Install phpMyAdmin on 10.8.x

Installing phpMyAdmin by Homebrew

HomebrewでphpMyAdminを入れる方法

※OS Xの中のApacheとPHPを動かして、MySQLをHomebrewで入れてる前提

それがまだなら、まずは以下を

Apache+PHP+MySQL(Homebrew) on Mountain Lion https://gist.github.com/3806975

HomebrewでPHPのあれこれを追加できるように

@eezis
eezis / Django EC2 Ubuntu
Last active August 12, 2019 15:58
Django on Amazon EC2 using Ubuntu
ALSO SEE THIS: http://eddychan.com/post/18484749431/minimum-viable-ops-deploying-your-first-django-app-to
AND THIS: http://bitnami.com/stack/django
These are my notes on how to quickly setup a python, virtualenv (use virtualenv-burrito FTW), and django.
Setup an EC-2 instance:
=======================
Use the quick launch wizard:
@fmasanori
fmasanori / gist:4126471
Created November 21, 2012 17:55
Python Reddit MongoDB Client
import json
import urllib
import pymongo
con = pymongo.Connection('mongodb://localhost',
safe = True)
db = con.reddit
stories = db.stories
url = 'http://www.reddit.com/r/Python/.json'
@jboynyc
jboynyc / topsy-scraper.py
Last active February 16, 2016 13:33
This is a short Python script to scrape data from Topsy through their API and store it in MongoDB. (Now they require an API key, so some changes are necessary to get it to work.)
#!/usr/bin/env python
from urllib2 import urlopen, urlencode
from pymongo import connection
import json
from optparse import OptionParser
from time import sleep
verbose = 1
parser = OptionParser()
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name

Product management process with Trello

A Trello board is a software equivalent of a physical wall with columns of sticky notes. In Trello terminology, the wall is called a "board." The columns are called "lists." The sticky notes in columns are called "cards."

No two products are the same, so flexibility in the product management process is important. Trello responds well to changing the structure of the process "on the fly."

@0m15
0m15 / mongo_chunk.py
Last active March 7, 2018 19:42
Python script that can export Mongo collections of any size into progressive numbered json chunks, type `python mongo_chunk.py --help` to have a list of available options
#!/usr/bin/python
import argparse
from pymongo import MongoClient as Client
from bson import BSON
from bson import json_util
import json
import os
# mongo client
@ungoldman
ungoldman / dokku_setup.md
Last active November 28, 2023 12:35
Deploy your own PaaS: Setting up Dokku with DigitalOcean and Namecheap

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.


This write-up is several years out of date! You probably shouldn't use it.