This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import redis | |
import random | |
import pylibmc | |
import sys | |
r = redis.Redis(host = 'localhost', port = 6389) | |
mc = pylibmc.Client(['localhost:11222']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# Built-in filename-based cache busting | |
# ---------------------------------------------------------------------- | |
# If you're not using the build script to manage your filename version revving, | |
# you might want to consider enabling this, which will route requests for | |
# /css/all.20110203.css to /res/all.css | |
# To understand why this is important and a better idea than all.css?v1231, | |
# read: github.com/paulirish/html5-boilerplate/wiki/Version-Control-with-Cachebusting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist | |
sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//to safely serialize | |
$safe_string_to_store = base64_encode(serialize($multidimensional_array)); | |
//to unserialize... | |
$array_restored_from_db = unserialize(base64_decode($encoded_serialized_string)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* ^/static/(\w+)/([^/]+)_\d+\.(js|css|png|jpg|jpeg|gif|ico)$ { | |
alias /srv/www/static/$1/$2.$3; | |
add_header Vary Accept-Encoding; | |
expires max; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctrl + alt + shift + t = refactor this | |
alt + enter = allerlei shortcuts | |
ctrl + alt + l = reformat code | |
shift + f11 = show bookmarks | |
f11 = insert bookmark | |
alt + insert = file new | |
ctrl + n = navigate class | |
ctrl + shift + n = navigate file | |
ctrl + shift + f = find in path | |
ctrl + alt + shift + insert = commit file (eigen shortcut) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: system, -apple-system, BlinkMacSystemFont, | |
"Helvetica Neue", "Lucida Grande"; | |
font-family: -apple-system, BlinkMacSystemFont, | |
"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", | |
"Fira Sans", "Droid Sans", "Helvetica Neue", | |
sans-serif; | |
/* https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/#details-of-approach-a */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
From Marty Walker Pastie | |
Picturefill markup with ProcessWire image sizing | |
https://github.com/scottjehl/picturefill/ | |
http://processwire.com/ | |
*/ | |
<div data-picture data-alt='{$page->title}'> | |
<div data-src='{$image->size(50,0)->url}'></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add this at the bottom of the page | |
var cb = function() { | |
var l = document.createElement('link'); l.rel = 'stylesheet'; | |
l.href = 'small.css'; | |
var h = document.getElementsByTagName('head')[0]; h.parentNode.insertBefore(l, h); | |
}; | |
var raf = requestAnimationFrame || mozRequestAnimationFrame || | |
webkitRequestAnimationFrame || msRequestAnimationFrame; | |
if (raf) raf(cb); | |
else window.addEventListener('load', cb); |