npm install -g [email protected]
jscodeshift -t codemods/templateCacheToWebpackImport.js src/
Based on http://orchestrate.io/blog/2014/03/26/tip-seamless-restarts-with-unicorn-and-upstart/
- On reboot Upstart launches Unicorn
- When Unicorn crashes is automatically relaunched
sudo service unicorn start/stop
to start/stop the servicecap unicorn:restart
do manually restart Unicorn
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 | |
# Refer: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem#Delaying_only_some_traffic | |
# Refer: http://www.bomisofmab.com/blog/?p=100 | |
# Refer: http://drija.com/linux/41983/simulating-a-low-bandwidth-high-latency-network-connection-on-linux/ | |
case "$1" in | |
start) | |
# Setup the rate control and delay | |
sudo tc qdisc add dev lo root handle 1: htb default 12 |
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 bash | |
# Usage: cached-bundle install --deployment | |
# | |
# After running `bundle`, caches the `vendor/bundle` directory to S3. | |
# On the next run, restores the cached directory before running `bundle`. | |
# When `Gemfile.lock` changes, the cache gets rebuilt. | |
# | |
# Requirements: | |
# - Gemfile.lock | |
# - REPO_SLUG |
- Copy the following
Gemfile
,Guardfile
,config/environments/development.rb
, thenbundle
- Configure your Android devices (see https://developers.google.com/chrome-developer-tools/docs/remote-debugging?hl=it#reverse-port-forwarding)
- In Chrome port forwarding settings set two forwards:
- 8080 => localhost:3000
- 5729 => localhost:5729
- Connect as much Android devices as possible (like this)
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
require "rubygems" | |
require "mechanize" | |
url = "http://www.palazzostrozzi.org/AnagraficaOpere.jsp?idForm=13&idMostra=%u" | |
browser = Mechanize.new { |agent| agent.user_agent_alias = 'Mac Safari' } | |
(1..20).each do |id_mostra| | |
begin | |
page = browser.get(url % id_mostra) |
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
(function addXhrProgressEvent($) { | |
var originalXhr = $.ajaxSettings.xhr; | |
$.ajaxSetup({ | |
xhr: function() { | |
var req = originalXhr(), that = this; | |
if (req) { | |
if (typeof req.addEventListener == "function" && that.progress !== undefined) { | |
req.addEventListener("progress", function(evt) { | |
that.progress(evt); | |
}, false); |
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
# /etc/init.d/dropbox | |
### BEGIN INIT INFO | |
# Provides: dropbox | |
# Required-Start: $network $syslog $remote_fs | |
# Required-Stop: $network $syslog $remote_fs | |
# Should-Start: $named $time | |
# Should-Stop: $named $time | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start and stop the dropbox daemon for debian/ubuntu |
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 | |
# e - Edit file in emacs client, launchin emacs daemon if necessary | |
# alternate falls on emacs --daemon | |
EMACS='emacsclient --alternate-editor=""' | |
# count opened window frames | |
XFRAMES=`emacsclient -e "(frame-list)" 2>/dev/null | grep -o '#<frame [^F][^>]*>' | wc -l` |