Skip to content

Instantly share code, notes, and snippets.

View mickaelandrieu's full-sized avatar
🏠
Working from home

Mickaël Andrieu mickaelandrieu

🏠
Working from home
View GitHub Profile
run:
casperjs index.js && convert *.jpg video.mpeg && gify video.mpeg out.gif && rm *.jpg video.mpeg
@JamieMason
JamieMason / run_e2e_tests
Created November 27, 2014 17:00
Run all CasperJS tests in a project using a glob file pattern.
#!/bin/bash
# Runs our end to end tests in casperjs.
# Run this script as follows from the project root;
#
# bin/run_e2e_tests
printf "\e[93m > SEARCHING FOR TEST FILES \033[0m \n"
find "$PWD" -iname "*.e2e.spec.js" -type f -print0 | while read -d '' -r file; do
@alexandresalome
alexandresalome / do.sh
Created September 28, 2012 12:50
generate self-signed SSL certificate
# Generate a private key
openssl genrsa -des3 -out server.key.org 1024
# Generate a CSR: Certificate Signing Request
openssl req -new -key server.key.org -out server.csr
# Remove password from key
openssl rsa -in server.key.org -out server.key
# Generate a self-signed certificate
@ludofleury
ludofleury / getset.sublime-snippet
Created February 15, 2013 02:25
PHP (Symfony) oriented getter-setter snippet for Sublime Text
<snippet>
<content><![CDATA[
/**
* Get $1
*
* @return ${2:[type]} \$$1
*/
public function get${1/(.*)/\u$1/}()
{
return \$this->${1:$SELECTION};
@ludofleury
ludofleury / atoum-is-awesome.php
Created March 8, 2013 10:44
The power of atoum, everything in my job should be so simple.
<?php
public function testAddBox()
{
$package = new Entity\Package();
$box = new \Mock\MyLittle\Bundle\BoxBundle\Entity\Box;
$this
->object($package->addBox($box))
->isIdenticalTo($package)
@davidbgk
davidbgk / plugin.js
Last active December 17, 2015 11:39
Boutez les ignominieuses fonctions anonymes hors de vos jQuery lors de SudWeb 2013
"use strict";
(function($, undefined) {
var Plugin, defaults, namespace;
namespace = 'myPopin';
defaults = {
duration: 1000,
onOpen: function() {}
};
@m4dz
m4dz / README.md
Last active March 17, 2016 13:26
jQuery plugins boilerplates

This files contains my boilerplates for jQuery plugins.

@dunglas
dunglas / invite-friends.js
Last active May 23, 2016 20:56
Invite all your Facebook friends (v3)
// Scroll to the bottom of the friend list and type the following line in your console
// For checkboxes (e.g. invite to an event)
var c = document.querySelectorAll("a[role='checkbox']"); for (var i = 0; i < c.length; i++) c[i].click();
// For invite buttons (e.g. invite to like a page)
var c = document.querySelectorAll(".uiButton._1sm"); for (var i = 0; i < c.length; i++) c[i].click();
@clochix
clochix / casperShell.js
Created October 8, 2013 09:37
Sample code to call a shell script from CasperJS
// (…)
var childProcess;
try {
childProcess = require("child_process");
} catch (e) {
this.log(e, "error");
}
if (childProcess) {
childProcess.execFile("/bin/bash", ["mycommand.sh", args1, args2, args3], null, function (err, stdout, stderr) {
this.log("execFileSTDOUT:", JSON.stringify(stdout), 'debug');
@jubianchi
jubianchi / sf2_standalone_form.php
Created August 25, 2011 07:31
How to use Symfony2 Form Component Standalone
<?php
namespace Standalone\Form;
use \Symfony\Component\HttpFoundation as SHttp;
use \Symfony\Component\Form as SForm;
use \Symfony\Component\DependencyInjection as SDI;
use \Symfony\Bridge as SBridge;
//Register all your autoload function here
//...