Skip to content

Instantly share code, notes, and snippets.

View marzocchi's full-sized avatar

Federico Marzocchi marzocchi

View GitHub Profile
@marzocchi
marzocchi / dogefy.sh
Last active October 6, 2023 18:55
dogefy.sh
zstyle ':notify:*' error-icon "https://media3.giphy.com/media/10ECejNtM1GyRy/200_s.gif"
zstyle ':notify:*' error-title "wow such #fail"
zstyle ':notify:*' success-icon "https://s-media-cache-ak0.pinimg.com/564x/b5/5a/18/b55a1805f5650495a74202279036ecd2.jpg"
zstyle ':notify:*' success-title "very #success. wow"
@marzocchi
marzocchi / FloatTest.php
Created January 12, 2016 12:42
Zend_Validate_FloatTest
<?php
class Zend_Validate_FloatTest extends PHPUnit_Framework_TestCase
{
/**
* @param mixed $value
* @param string $locale
* @dataProvider localesDataProvider
*/
public function testLocales($value, $locale)
@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
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Process\ProcessBuilder;
/**
* @author marzocchi
*/
class RequestToCurlTranslator {
@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
@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 / xpath.php
Created October 22, 2013 10:32
find nodes by content in an XML document using XPath
<?php
$doc = new \DomDocument();
$doc->loadXML(file_get_Contents(__DIR__ . '/cities.xml'));
$xp = new \DOMXpath($doc);
echo $xp->query("//return/country[contains(., 'Italy (IT)')]")->length;
@marzocchi
marzocchi / .borisrc
Last active December 17, 2015 07:49
Boots a Symfony 2.0 kernel when running boris from the project directory, and make the DIC available as $container.
<?php
/**
* Boots a Symfony 2.0 kernel when running boris from the project directory, and
* make the DIC available as $container.
*/
require_once __DIR__ . '/app/bootstrap.php.cache';
require_once __DIR__ . '/app/AppKernel.php';
@marzocchi
marzocchi / .gitignore
Last active December 17, 2015 03:08
Vagrantfile and Puppet manifest
.vagrant/*
@marzocchi
marzocchi / nginx.conf
Created November 23, 2012 23:53
nginx.conf
daemon off;
http {
proxy_cache_path /usr/local/var/cache/nginx keys_zone=anon:10m;
server {
listen 8888;
server_name foo;