Skip to content

Instantly share code, notes, and snippets.

// $mq-mobile-portrait : 320px !default;
// $mq-mobile-landscape : 480px !default;
// $mq-tablet-portrait : 640px !default; -- changed because i want my blog content is around this wide, not 768. you should let content & design determine your breakpoints
// $mq-tablet-landscape : 1024px !default;
// $mq-desktop : 1382px !default;
$mq-mobile-portrait : 20em !default;
$mq-mobile-landscape : 30em !default;
$mq-tablet-portrait : 40em !default;
$mq-tablet-landscape : 64em !default;
.highlight {
background-color: #efefef;
padding: 7px 7px 7px 10px;
border: 1px solid #ddd;
-moz-box-shadow: 3px 3px rgba(0,0,0,0.1);
-webkit-box-shadow: 3px 3px rgba(0,0,0,0.1);
box-shadow: 3px 3px rgba(0,0,0,0.1);
margin: 20px 0 20px 0;
overflow: hidden;
@atiw003
atiw003 / mysql_pid_fslatency_slowlog0.d
Created October 28, 2012 01:13 — forked from vmunix/mysql_pid_fslatency_slowlog0.d
MySQL slow queries caused by filesystem latency
#!/usr/sbin/dtrace -s
/*
* mysqld_pid_fslatency_slowlog0.d Print slow filesystem I/O events.
*
* USAGE: ./mysql_pid_fslatency_slowlog0.d mysqld_PID
*
* This traces all mysqld filesystem I/O (including some that may be
* asynchronous to queries and not causing query latency), and prints
* those individual I/O taking longer than the MIN_FS_LATENCY_MS tunable.
*
@atiw003
atiw003 / gist:3884326
Created October 13, 2012 11:55 — forked from brajeshwar/gist:1886227
Sublime Text 2 Shortcuts for Mac

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@atiw003
atiw003 / icomoon.css
Created August 4, 2012 12:36
CSS: IcoMoon Font
/**
* Stylesheet that implements free IcoMoon font
* http://keyamoon.com/icomoon/#toHome
*
* Autor Yordan Ivanov
* yordan.t.ivanov@gmail.com
*/
@font-face {
font-family: 'IcoMoonRegular';
@atiw003
atiw003 / README.md
Created August 2, 2012 22:46 — forked from baldurthoremilsson/README.md
File hash GET parameters for Django staticfiles

About

A class for the static files app in Django that invalidates outdated browser cache.

How to use

You add the line

STATICFILES_STORAGE = 'path.to.hashpathstaticfilesstorage.HashPathStaticFilesStorage'
@atiw003
atiw003 / s3clonebucket.py
Created July 21, 2012 23:39 — forked from erans/s3clonebucket.py
Clone S3 Bucket
import argparse
from boto.s3.connection import S3Connection
from boto.exception import S3ResponseError
def run(args):
s3_connection = S3Connection(args.aws_access_key, args.aws_secret_access_key)
source_bucket = s3_connection.get_bucket(args.source_bucket)
destination_bucket = None
try:
@atiw003
atiw003 / gist:3029700
Created July 1, 2012 21:27 — forked from sadache/gist:3026886
Bits'bout Play2 Architecture

Play2 Simple HTTP API

Essential blueprint of Play2 architecture is pretty simple and it should be easy to explain in a fairly short blog post. The framework can be understood progressively at different levels; each time having better exposure to some aspects of its design.

The core of Play2 is really small, surrounded by a fair amount of useful APIs, services and structure to make Web Programming tasks easier.

Basically, Play2 is an API that abstractly have the folllowing type

RequestHeader -> Array[Byte] -> Result 
@atiw003
atiw003 / django.vcl
Created June 30, 2012 23:42 — forked from ghughes/django.vcl
Django VCL for Varnish
sub vcl_recv {
# unless sessionid/csrftoken is in the request, don't pass ANY cookies (referral_source, utm, etc)
if (req.request == "GET" && (req.url ~ "^/static" || (req.http.cookie !~ "sessionid" && req.http.cookie !~ "csrftoken"))) {
remove req.http.Cookie;
}
# normalize accept-encoding to account for different browsers
# see: https://www.varnish-cache.org/trac/wiki/VCLExampleNormalizeAcceptEncoding
if (req.http.Accept-Encoding) {
if (req.http.Accept-Encoding ~ "gzip") {
@atiw003
atiw003 / gist:3008778
Created June 28, 2012 03:34 — forked from lqez/gist:1520810
An alternative approach to drop all tables in django project
#!/usr/bin/python
# Alternative approach.
import os
import MySQLdb
print 'drop remaining tables...'
for name, db in settings.DATABASES.iteritems():
conn = MySQLdb.connect( db['HOST'], db['USER'], db['PASSWORD'], db['NAME'] )