Skip to content

Instantly share code, notes, and snippets.

View marzocchi's full-sized avatar

Federico Marzocchi marzocchi

View GitHub Profile
@marzocchi
marzocchi / gist:786bd06cf3bfd7831dcf
Last active August 29, 2015 14:06
attempt to get an iTerm2 tab by its tty
tell application "iTerm"
set tt to sessions of tabs of terminal windows whose tty is equal to "/dev/ttys001"
-- result is this nested list:
-- {{{select 1 of select 1 of application "iTerm"}}}
end tell
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Process\ProcessBuilder;
/**
* @author marzocchi
*/
class RequestToCurlTranslator {
@marzocchi
marzocchi / my-jira-week
Last active August 29, 2015 14:24
Print the stuff I worked on this week, if it was updated by someone
#!/bin/sh
# Needs jira-cmd: https://github.com/germanrcuriel/jira-cmd
set -e
monday=$(date -v "-"$(date +"%u")"d" -v +1d +"%Y-%m-%d 00:00")
query="assignee was currentUser() AND updatedDate > '"$monday"'"
jira jql -- "$query"
echo Query: $query
unset query
@marzocchi
marzocchi / config.ru
Created July 1, 2011 09:15
Run Symfony apps with Rack (rackup! pow!)
# vim:se filetype=ruby
# vim:se foldlevel=3
#
# Hacks and monkeys to run Symfony 1.4 applications as Rack apps using
# the rack-legacy and rack-rewrite gems.
#
# A couple of rack-rewrite rules take care of handing requests to the
# default front controller (index.php) and a subclass of rack-legacy's
# Php fixes PATH_INFO for Symfony routing.
#
@marzocchi
marzocchi / php.rb
Created August 18, 2011 16:22
PHP formula for homebrew
require 'formula'
class Php < Formula
url 'http://it.php.net/distributions/php-5.3.8.tar.gz'
homepage 'http://php.net/'
md5 'f4ce40d5d156ca66a996dbb8a0e7666a'
version '5.3.8'
# depends_on 'cmake'
depends_on 'mysql'
@marzocchi
marzocchi / vim.rb
Created August 18, 2011 16:27 — forked from uasi/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.206'
def features; %w(tiny small normal big huge) end
@marzocchi
marzocchi / desktop-icons.rb
Created September 27, 2011 21:47
Save and restore Finder's desktop icons position
#!/usr/local/bin/macruby
# Damn evil Finder will insist crashing and reshuffling
# icons in my carefully laid out desktop.
require 'rubygems'
require 'thor'
require 'yaml'
framework "ScriptingBridge"
$ ./tmux -C
./tmux: illegal option -- C
usage: tmux [-28lquvV] [-c shell-command] [-f file] [-L socket-name]
[-S socket-path] [command [flags]]
#!/bin/zsh
# curl https://raw.github.com/gist/1632892/ranger.sh | zsh
curl http://nongnu.org/ranger/ranger-stable.tar.gz | tar xvz
cd ranger-1.5.2
sudo make install
@marzocchi
marzocchi / own.sh
Created January 18, 2012 12:43
own
#!/bin/zsh
# curl https://raw.github.com/gist/1632835/own.sh | zsh
echo Installing packages
sudo apt-get install git zsh vim
echo Setting shell..
chsh -s /bin/zsh