Skip to content

Instantly share code, notes, and snippets.

@mstepniowski
mstepniowski / testing.py
Last active December 17, 2015 07:49
Custom Django test suite runners, which can be used to speed up your test suite.
# Copyright (c) 2011-2013, Marek Stepniowski
# All rights reserved. (FreeBSD License).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
@ionelmc
ionelmc / profiled_decorator.py
Last active February 19, 2017 09:49
Profiling decorator that generates kcachegrind output.
import cProfile
import os
import pstats
import time
from datetime import datetime
from functools import wraps
from io import StringIO
from logging import getLogger
logger = getLogger(__name__)
@idan
idan / _responsive.scss
Created June 9, 2013 23:50
Responsive SCSS Mixins
@mixin linear {
@media screen and (max-width: 45em) {
@content;
}
}
@mixin mobile-landscape {
@media screen and (max-width: 30em) {
@content;
}
@kartoch
kartoch / mutator.txt
Last active February 28, 2018 16:16
Muttator Cheatsheet
A Muttator Reference Sheet / Cheat Sheet
Muttator v0.6 for Thunderbird v3.0 and 3.1.* (muttator-20100629.xpi)
The main thing to know about using Muttator is that there are two primary modes, EX mode and MESSAGE mode,
and keyboard mappings can work very differently in the two modes. It's not obvious which mode you're in;
you have to look at the bottom left of your Thunderbird window where the status line with either be blank
(EX mode) or will say "-- MESSAGE --". There is also an odd "-- CARET --" mode that you'll probably want
to <ESC> out of as soon as possible.
@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active May 20, 2025 07:59
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@velicast
velicast / stdc++.h
Created July 17, 2013 17:56
Linux GCC 4.8.0 /bits/stdc++.h header definition.
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@kirikaza
kirikaza / fix-git-packfiles.sh
Created August 7, 2013 21:08
Fixes unaccessable packfiles in the git repo, i.e. errors like "packfile .git/objects/pack/pack-<hash>.pack cannot be accessed". If there are no such packfiles, the script just does "git gc". It is safe enough. See http://stackoverflow.com/a/14571150/421146
#!/bin/bash
packlist=`mktemp`
git gc 2>&1 |
grep '^warning: packfile .* cannot be accessed$' |
cut -d' ' -f3 |
sort -u > $packlist
packs_count=`wc -l < $packlist`
temp=`mktemp`
@hofmannsven
hofmannsven / README.md
Last active July 10, 2025 04:46
Git CLI Cheatsheet
@sloria
sloria / bobp-python.md
Last active May 28, 2025 02:41
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@punchagan
punchagan / scrape_google_groups.py
Last active August 21, 2024 08:02
A simple script to scrape a google group.
import json
from os.path import exists
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
class GoogleGroupsScraper(object):
""" A simple class to scrape a google group. """