There was a recent article on [State of the Art JavaScript][1]. It's fully of dated / wrong recommendations.
Let's see what he is recommending:
JavaScript is awesome and state of the art ;)
(function($) { | |
// Add inner and outer width to zepto (adapted from https://gist.github.com/alanhogan/3935463) | |
var ioDim = function(dimension, includeBorder) { | |
return function (includeMargin) { | |
var sides, size, elem; | |
if (this) { | |
elem = this; | |
size = elem[dimension](); | |
sides = { | |
width: ["left", "right"], |
#!/bin/bash | |
# https://gist.github.com/robwierzbowski/5430952/ | |
# Create and push to a new github repo from the command line. | |
# Grabs sensible defaults from the containing folder and `.gitconfig`. | |
# Refinements welcome. | |
# Gather constant vars | |
CURRENTDIR=${PWD##*/} | |
GITHUBUSER=$(git config github.user) |
#!/bin/bash | |
VERBOSITY=0 | |
TEMP_D="" | |
FORMATS=( | |
qcow2 | |
qcow2-compressed | |
raw | |
azure | |
azure-dynamic | |
azure-fixed |
#!/usr/bin/python | |
# | |
# List all files that have ever been committed in this repository, in any | |
# commit in any branch. | |
import pygit2 | |
import stat | |
def list_all_files(repo_path): | |
repo = pygit2.Repository(repo_path) |
from ghost import Ghost | |
from PySide.QtGui import QApplication, QImage, QPainter, QPrinter | |
class MyGhost(Ghost): | |
def capture_pdf(self): | |
printer = QPrinter(QPrinter.HighResolution) | |
printer.setResolution(300) | |
printer.setOutputFileName("QtPrinter.pdf") | |
printer.setPaperSize(QPrinter.A4) |
Simple example on how to make Twitter Bootstrap typeahead working with backbone collections. | |
Usage : | |
var bui = new Bootstrap.Typeahead({ | |
collection: ? | |
property: ? | |
items: ? | |
... | |
}); |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
def run_pg_fouine(): | |
info = host_info[env.host_string] | |
db_name = info.tags.get('Name') | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
time.sleep(30) | |
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf') | |
sudo('/etc/init.d/postgresql reload') | |
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt') | |
run('gzip -f /tmp/pgfouine.txt') |