Skip to content

Instantly share code, notes, and snippets.

View marzocchi's full-sized avatar

Federico Marzocchi marzocchi

View GitHub Profile
iterm-notify config-set failure-icon "https://media3.giphy.com/media/10ECejNtM1GyRy/200_s.gif"
iterm-notify config-set failure-title "wow such #fail"
iterm-notify config-set success-icon "https://s-media-cache-ak0.pinimg.com/564x/b5/5a/18/b55a1805f5650495a74202279036ecd2.jpg"
iterm-notify config-set success-title "very #success. wow"
@marzocchi
marzocchi / config.fish
Last active November 26, 2019 22:47
config.fish
if status is-interactive > /dev/null
function fish_vi_cursor; end
fish_vi_key_bindings
function fish_greeting
end
function first_prompt_line --on-event fish_prompt
set_color red
@marzocchi
marzocchi / recover-double-encrypted.sh
Created October 24, 2019 13:11
Recover files that ended up being double-encrypted while using git-crypt
#!/bin/sh
set -e
hash() {
if [[ $# != 1 ]]; then
echo "usage: hash FILE" >&2
return 1
fi
shasum "$1" | cut -f1 -d' '
@marzocchi
marzocchi / main.go
Last active September 13, 2018 15:19
bin/parse-url
package main
import (
"bufio"
"fmt"
"gopkg.in/yaml.v2"
"net/url"
"os"
)
@marzocchi
marzocchi / config.ini
Created August 14, 2018 10:49
Git difftool configuration for comparing MySQL schemas
[diff]
tool = diff-for-schema
[difftool]
prompt = false
[difftool "diff-for-schema"]
cmd = diff --show-function-line='^CREATE TABLE' -U1 -- "$LOCAL" "$REMOTE"
@marzocchi
marzocchi / manifest.json
Last active April 5, 2018 14:09
Chrome extension that overrides navigator.geolocation with Mocklocation in all pages
{
"manifest_version": 2,
"name": "Mocklocation",
"description": "Override navigator.geolocation with Mocklocation",
"version": "0.1",
"permissions": [
"http://*/*",
"https://*/*"
],
@marzocchi
marzocchi / services.yml
Created September 22, 2012 12:08
Use ClassMetadata as a service
services:
# Use an entity's ClassMetadata as if it where a service (for example, in
# other services definitions).
#
# See http://symfony.com/doc/2.0/components/dependency_injection/factories.html
foo.foo_class_metadata:
class: "Doctrine\\Common\\Persistence\\Mapping\\ClassMetadata"
factory_service: doctrine.orm.entity_manager
factory_method: getClassMetadata
arguments:
@marzocchi
marzocchi / dme.sh
Created July 7, 2017 08:59
zsh hook for loading docker-machine env by containing dir
devbox-register-hook() {
autoload add-zsh-hook
add-zsh-hook chpwd devbox-load-env
}
devbox-unregister-hook() {
autoload add-zsh-hook
add-zsh-hook -d chpwd devbox-load-env
}
@marzocchi
marzocchi / Makefile
Last active June 4, 2017 23:16
`make build` done right
# build depends on bin/homework
build: bin/homework
# bin/homework depends on all .go files in this directory tree
bin/homework: $(shell find . -name '*.go' -not -path './vendor/*')
go build -o bin/homework main.go
@marzocchi
marzocchi / WebDriverCurlService.php
Created June 3, 2017 11:42 — forked from markpol/WebDriverCurlService.php
customizing Curl Options for WebDriver client
<?php
namespace Tests;
use WebDriver\Service\CurlService;
use WebDriver\Service\CurlServiceInterface;
/**
* Class WebDriverCurlService
* @package Tests