⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
// $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; |
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
.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; |
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/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. | |
* |
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
/** | |
* Stylesheet that implements free IcoMoon font | |
* http://keyamoon.com/icomoon/#toHome | |
* | |
* Autor Yordan Ivanov | |
* [email protected] | |
*/ | |
@font-face { | |
font-family: 'IcoMoonRegular'; |
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
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: |
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
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
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") { |
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/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'] ) |
NewerOlder