Skip to content

Instantly share code, notes, and snippets.

@JakeCoxon
JakeCoxon / github.js
Last active December 4, 2019 14:36
Github PRs Highlight name
let username = document.querySelector('meta[name="user-login"]').getAttribute('content');
document.querySelectorAll('.js-issue-row').forEach(row => {
let userLink = row.querySelector('a[data-hovercard-url="/users/' + username + '/hovercard"]')
if (!userLink) return;
Object.assign(userLink.style, {
background: '#3940c3',
borderRadius: '5px',
@majackson
majackson / migrations.md
Last active August 16, 2024 12:51
Django migrations without downtime

Django Migrations without Downtime

The following instructions describe a set of processes allowing you to run Django database migrations against a production database without having to bring the web service down.

Note that in the below instructions, migrations are all run manually at explicit points, and are not an automatic part of the deployment process.

Adding Fields or Tables

Adding a (nullable) field or a new table

  1. Make the model or column addition in your code.
@pylover
pylover / a2dp.py
Last active August 11, 2024 06:11
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@mariosotil
mariosotil / ds4drv
Created March 14, 2016 07:28
ds4drv service to be installed on init.d
#! /bin/sh
### BEGIN INIT INFO
# Provides: ds4drv
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: ds4drv daemon
# Description: ds4drv daemon
### END INIT INFO
@bmispelon
bmispelon / django.md
Last active November 17, 2015 09:58
DjangoGirls/Django sprints @ EuroPython

Django Sprint @ EuroPython

Communication

Join the #django-sprint channel on IRC (Freenode). If IRC won't connect, try the web client at http://webchat.freenode.net/

@yonatanmn
yonatanmn / css sprite with sass (scss)
Last active July 17, 2017 15:14
css sprite with sass (scss)
//usage is pretty simple:
//1. create a sprite of square images (if the icon is not square, save it inside a square anyway):
// example: http://glue.readthedocs.org/en/latest/_images/famfamfam2.png
//2. define sass map with the keys specified:
$mySprite:(
url: '../images/mySprite.png',
names: ('createIcon','player','bell','notifications','icon13','icon15'...), //names of all of the icons in sprite
itemsInRow: 10, //sprite structure
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real