Skip to content

Instantly share code, notes, and snippets.

View Swop's full-sized avatar
👨‍💻

Sylvain MAUDUIT Swop

👨‍💻
View GitHub Profile
@Swop
Swop / Dominos.py
Created March 14, 2016 19:56
Check Domino's pizza delivery status and push an OSX notification after each status change. Yummy
import json
import urllib2
import sys
import time
from Foundation import NSUserNotification
from Foundation import NSUserNotificationCenter
from Foundation import NSUserNotificationDefaultSoundName
orderId = sys.argv[1]
step = previousStep = None
@Swop
Swop / gist:6a5f1999e1a04227e382
Created December 11, 2014 10:17
Git merge test command (to detect potential conflicts)
#!/bin/bash
git config --global alias.mergetest '!f(){ git merge --no-commit --no-ff "$1"; git merge --abort; echo "Merge aborted"; };f '
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

Forum PHP 2014

Jeudi 23/10

  • 9h30
    • A State of Mind. Sebastian Bergmann
    • La mesure, ce n'est pas que pour le devops. Olivier Garcia & Patrick Allaert
  • 10h15
@Swop
Swop / delete_merge_branches.sh
Created October 21, 2014 10:00
Deletes merged branches
#!/bin/bash
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
@Swop
Swop / gist:af36041fc71aedfb6d4d
Created August 18, 2014 17:01
Delete old Linux kernels (Ubuntu)
dpkg --get-selections|grep 'linux-image*'|awk '{print $1}'|egrep -v "linux-image-$(uname -r)|linux-image-generic|linux-image-extra-$(uname -r)" |while read n;do apt-get -y remove $n;done
@Swop
Swop / UrlEncodeType.php
Created August 2, 2014 11:33
UrlEncodeType (credits: Benjamin Marquant)
<?php
/**
* @author Benjamin Marquant
* @website http://www.bxnxg.com
* @example http://website.com/My Fân Page !/ > http://website.com/my-fan-page/ and become a simple url rewriting
*/
class UrlEncodeType {
private $url;
---
language: node_js
node_js:
- '0.10'
branches:
only:
- master
before_script: .travis/before_script.sh
script: echo -e " >>> Do something... \"grunt\" for example\n"
after_success: .travis/after_success.sh
@Swop
Swop / Hooks.php
Last active July 15, 2016 06:16
Console app to check quality of a project (for a pre-commit hook) (source: http://carlosbuenosvinos.com/write-your-git-hooks-in-php-and-keep-them-under-git-control/)
<?php
namespace Swop\Composer\Script;
use Composer\Script\Event;
class Hooks
{
public static function checkHooks(Event $event)
{
@Swop
Swop / Install hhvm debian
Created April 18, 2014 17:39
Install hhvm debian
deb http://dl.hhvm.com/ubuntu saucy main
apt-get update
apt-get install hhvm
/etc/init.d/hhvm start
and in nginx config
location ~ \.php$ {