Skip to content

Instantly share code, notes, and snippets.

View alexandresalome's full-sized avatar

Alexandre Salomé alexandresalome

View GitHub Profile
@alexandresalome
alexandresalome / README
Created February 5, 2014 14:19
PHP - Getters and Setters for SublimeText
This SublimeText macro will generate your PHP getters and setters automatically.
Just create a list of attributes you want to generate getters and setters for:
class User
{
firstname
lastname
}
@alexandresalome
alexandresalome / clipboard-editor
Created December 7, 2014 21:43
clipboard-editor
#!/bin/bash
#
# Clipboard Editor - edit your clipboard in your favorite editor
set -e
# xclip command to execute
XCLIP_COMMAND="xclip -sel clipboard" # works on Xubuntu
# editor to use
@alexandresalome
alexandresalome / command.php
Last active August 29, 2015 14:11
Command example
<?php
use Symfony\Component\Console\Application;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\EventDispatcher\EventDispatcher;
require_once __DIR__.'/vendor/autoload.php';
#!/bin/bash
gource -a 0.1 -s 1 -i 0
@alexandresalome
alexandresalome / security-password-encoder.php
Created January 26, 2015 18:16
Demonstration of password encoder
<?php
<<<CONFIG
packages:
- symfony/security
CONFIG;
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
use Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder;
# $encoder = new MessageDigestPasswordEncoder();
@alexandresalome
alexandresalome / clipboard-editor
Created February 4, 2015 11:25
Edit your clipboard
#!/bin/bash
#
# Clipboard Editor - edit your clipboard in your favorite editor
set -e
# xclip command to execute
XCLIP_COMMAND="xclip -sel clipboard" # works on Xubuntu
# editor to use
<?
class Car
{
publc function __construct($id)
{
$this->id = $id;
}
/**
#!/bin/bash
#
# Synchronization script for a project.
#
# This script will synchronize with production environment
#
[ "$1" = "go" ] && DryRun="" || DryRun="--dry-run"
[ "$1" = "go" ] && DeleteCommand="rm -rf" || DeleteCommand="ls"
<?php
class CalcSteps
{
protected $calc;
protected $screen;
public function start()
{
$this->calc = new Calc();