Skip to content

Instantly share code, notes, and snippets.

View KristianOellegaard's full-sized avatar

Kristian Øllegaard KristianOellegaard

View GitHub Profile
@saggineumann
saggineumann / client_workflow.py
Created February 29, 2016 09:37
Client workflow
# to install xplenty python SDK run: pip install xplenty
# more info here: https://github.com/xplenty/xplenty.py
from xplenty import XplentyClient
import time
account_id = "" # your account id (http://app.xplenty.com/account_id/)
api_key = "" # your api key (get it here https://app.xplenty.com/settings/edit)
cluster_nodes = 1 # required number of nodes in cluster
@RyanGWU82
RyanGWU82 / capture-boto3.py
Created July 15, 2015 18:54
Do you use boto3 or botocore? Want to capture and inspect your AWS API traffic? This script will send all AWS API traffic to a Runscope bucket for analysis and debugging.
# Do you use boto3 or botocore? Want to capture and inspect your AWS API
# traffic? This script will send all AWS API traffic to a Runscope bucket for
# analysis and debugging.
#
# Instructions:
# 1. Sign up for an account at https://www.runscope.com if you don't already
# have one.
# 2. Your account will have a single bucket. Get the Bucket Key from Runscope's
# Traffic Inspector tab; paste that into the RUNSCOPE_BUCKET_KEY constant.
# 3. Go to https://www.runscope.com/applications and create a new application.
@cheeaun
cheeaun / sonos-hipchat.js
Last active August 4, 2016 17:25
Sonos-2-HipChat notification node.js script
npm install sonos
npm install git://github.com/balbeko/node-hipchat.git

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

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active September 15, 2024 10:33
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@phpdude
phpdude / nginx.conf
Last active August 21, 2024 20:58
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@jonasvp
jonasvp / harvest_monthly_budgets.py
Created November 1, 2011 09:20
Monthly budgets for harvest: cronjob for rotating projects
#!/usr/bin/env python
'''
Harvest (www.getharvest.com) does not support setting monthly budgets for projects.
The recommended workaround is creating a new project every month. This script is
supposed to run on the first of every month and uses the Harvest API in order to
archive last month's projects and create new ones for the current month. Members
and tasks are automatically copied over to the new project.
Projects with monthly budgets need to fulfill two requirements:
1. They need to have a budget set