Skip to content

Instantly share code, notes, and snippets.

@sirMackk
sirMackk / thinkpad_bt_disable
Last active January 14, 2017 09:53
Thinkpad - disable bluetooth on startup
0. Ensure rfkill is installed - "sudo apt-get install rfkill"
1. sudo vim /etc/rc.local
2. paste "rfkill block bluetooth" ABOVE exit 0
3. :w
@sirMackk
sirMackk / django_light.py
Created December 19, 2016 15:23
Django 1.10 in a single module w/ working admin and staticfiles
import sys
import logging
from django import setup
from django.conf import settings
from django.http import HttpResponse
from django.conf.urls import url
from django.contrib import admin
@sirMackk
sirMackk / gist:afeb722180854588dc3cf18acd4500a8
Created November 22, 2016 13:45
updating single container in docker-compose group
docker-compose -f docker-compose.yml -p app up -d --no-deps --build NAME
@sirMackk
sirMackk / css-transitions-on-hidden.css
Created October 28, 2016 13:38
Attributes to use when trying to transition elements from none to block - uses height instead.
div {
transition: opacity 1s ease-out;
opacity: 0;
height: 0;
overflow: hidden;
}
div.active {
opacity: 1;
height: auto;
}
@sirMackk
sirMackk / col-fix.css
Created October 27, 2016 14:24
Making css columns work across all browsers
.user-content {
column-count: 2;
// The inline-block, last-child:block, and avoid-column
// are required for columns to display consistantly
// across all browsers.
p {
break-inside: avoid-column;
display: inline-block;
margin: 0;
@sirMackk
sirMackk / Pypi monthly downloads example query
Last active October 17, 2016 15:18
Getting pypi download stats for py3tftp
SELECT file.project,
COUNT(*) as total_downloads FROM TABLE_DATE_RANGE(
[the-psf:pypi.downloads],
TIMESTAMP("20160801"),
TIMESTAMP("20160901")
) where file.project = 'py3tftp' group by file.project
URL: https://bigquery.cloud.google.com/dataset/the-psf:pypi

Keybase proof

I hereby claim:

  • I am sirmackk on github.
  • I am matt_o (https://keybase.io/matt_o) on keybase.
  • I have a public key whose fingerprint is BF7A 35EF D857 C604 0EBF 29A6 E8ED 9834 2975 17C2

To claim this, I am signing this object:

@font-face {
@include font-face('nexa-bold-italic', '../fonts/nexa/Nexa Bold Italic');
}
@font-face {
@include font-face('nexa-bold', '../fonts/nexa/Nexa Bold');
}
@font-face {
@include font-face('nexa-book-italic', '../fonts/nexa/Nexa Book Italic');
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
minifyCSS = require('gulp-minify-css'),
autoprefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
del = require('del');
// sprites?
var paths = {
@sirMackk
sirMackk / gist:7465718
Created November 14, 2013 12:03
Rails Spring automation continued
function! SpringStop()
if filereadable("config/spring.rb")
exec ":!spring stop"
end
endfunction
function! RakeRoutesDo(path)
if filereadable("config/spring.rb")
exec ":!spring rake routes | grep " . a:path
else