Skip to content

Instantly share code, notes, and snippets.

View mmenozzi's full-sized avatar
💻
CTO at Webgriffe®

Manuele Menozzi mmenozzi

💻
CTO at Webgriffe®
View GitHub Profile
@mmenozzi
mmenozzi / find_test.sh
Created December 14, 2012 20:14
Find test
#!/bin/bash
mkdir /tmp/findtest
mkdir /tmp/findtest/.git
mkdir /tmp/findtest/.foo
touch /tmp/findtest/.foo/.bar
touch /tmp/findtest/.bar
touch /tmp/findtest/test.py
mkdir /tmp/findtest/foo
touch /tmp/findtest/foo/bar.tmp
touch /tmp/findtest/test.php
@mmenozzi
mmenozzi / find_who_breaks.php
Created December 19, 2012 08:39
Simple PHP script to find out wich commit broke given test command.
<?php
$sinceDate = '11/01/2012'; // Change to fit your needs
$testCommand = 'phpunit src/Symfony/Component/Finder'; // Change to fit your needs
$revlist = array();
exec("git log --since=$sinceDate --branches=master --reverse --pretty=%H | cat", $revlist);
foreach ($revlist as $commit) {
$form->add(
$bundle_key,
'choice',
array(
'label' => 'Bundle languages ' .$bundle_key,
'choices' => array(
'' => 'not defined',
'it' => 'it',
'en' => 'en',
),
<?php
namespace Charlie\RecruitmentBundle\Tests\Functional;
use Charlie\FixtureBundle\Test\FixtureWebTestCase;
/**
* Created by JetBrains PhpStorm.
* User: ftassi
* Date: 17/01/13
@mmenozzi
mmenozzi / OpenDocumentToPdfConverter.php
Created January 22, 2013 15:13
OpenOffice (unoconv) Word to PDF
/**
* @param $sourceFile
* @param $destinationFilePath
* @throws \RuntimeException
* @throws \Exception
*/
private function doConvert($sourceFile, $destinationFilePath)
{
$output = array();
exec("unoconv --output=\"" . $destinationFilePath . "\" \"" . $sourceFile . "\"", $output);
/**
* Recupera la entity da utilizzare per memorizzare l'intervista
*
* @param $interviewId
* @param \Doctrine\Common\Persistence\ObjectManager $em
* @return object
*/
public function findEntity($interviewId, ObjectManager $em)
{
$repositoryMap = array(
/**
* Recupera la entity da utilizzare per memorizzare l'intervista
*
* @param $interviewId
* @param \Doctrine\Common\Persistence\ObjectManager $em
* @return object
*/
public function findEntity($interviewId, ObjectManager $em)
{
$repositoryMap = array(
@mmenozzi
mmenozzi / NotificationSender.php
Created February 16, 2013 14:56
APNS Payload
$body = array(
'aps' => array(
'alert' => $message,
'badge' => 1,
'sound' => 'default'
)
);
if (!is_null($section)) {
$body['section'] = $section;
@mmenozzi
mmenozzi / Sostituzione disco in RAID con grub install.md
Last active April 17, 2020 14:52
Sostituzione disco in RAID con grub install

Sostituzione disco in RAID con grub install

Si assume che il disco da sostituituire sia /dev/sda mentre il disco buono sia /dev/sdb.

Rimozione del disco dall array RAID

Innanzi tutto, se non ancora stato fatto, è necessario marcare come fallito e poi rimuovere il disco /dev/sda/ dall'array RAID.

@mmenozzi
mmenozzi / iterm-fit-and-set-bg
Created August 2, 2013 06:45
Script that resizes and crop an image and then sets as background for iTerm
#!/bin/bash
# Script that resizes and crop an image and then sets as background for iTerm
# First, check to see if we have the correct terminal!
if [ "$(tty)" == 'not a tty' ] || [ "$TERM_PROGRAM" != "iTerm.app" ] ; then
exit $?
fi
# Console dimensions