Skip to content

Instantly share code, notes, and snippets.

View dariodiaz's full-sized avatar

Dario Diaz dariodiaz

View GitHub Profile
@dariodiaz
dariodiaz / laravel-security-checker.md
Created March 3, 2014 20:38 — forked from barryvdh/laravel-security-checker.md
php laravel: symfony security checker

Symfony Security Checker in Laravel

Artisan command for Sensiolabs Security Checker

Require this project in your composer.json file

"sensiolabs/security-checker": "dev-master"

Add the following line to app/start/artisan.php:

@dariodiaz
dariodiaz / Excel.php
Created March 3, 2014 20:35 — forked from barryvdh/Excel.php
php laravel: Excel to array class util
<?php
use Illuminate\Support\Contracts\ArrayableInterface;
use Illuminate\Support\Contracts\JsonableInterface;
class Excel implements ArrayableInterface, JsonableInterface{
protected $objPHPExcel;
public function __construct($file){
if($file instanceof \SplFileInfo){
$filename = $file->getRealPath();
@dariodiaz
dariodiaz / vhost.py
Created February 19, 2014 16:45 — forked from fideloper/vhost.py
apache: tool to configure virtual hosts easily
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#
@dariodiaz
dariodiaz / CleverLink.php
Created February 17, 2014 20:02
php laravel: macro to change current active link
@dariodiaz
dariodiaz / selenium.sh
Created February 10, 2014 13:05 — forked from jakzal/selenium.sh
selenium: start server and nodes config
#!/bin/sh
command=${1:-"help"}
SELENIUM_VERSION="2.39.0"
NODE_OPTIONS="-browser browserName=phantomjs"
download() {
[ -f selenium-server-standalone.jar ] || wget http://selenium.googlecode.com/files/selenium-server-standalone-${SELENIUM_VERSION}.jar -Oselenium-server-standalone.jar
}
@dariodiaz
dariodiaz / laravel_env
Last active August 29, 2015 13:56 — forked from antonioribeiro/gist:8429426
laravel: environment configuration
Create a .environment file in the root of your application and define your environment and gitignore it:
```
return array(
'LARAVEL_ENV' => 'development',
'POSTGRESQL.HOST' => 'localhost',
'POSTGRESQL.DATABASE_NAME' => 'laraveldatabase',
'POSTGRESQL.DATABASE_USER' => 'laraveluser',
@dariodiaz
dariodiaz / gulpfile.js
Created January 30, 2014 03:33 — forked from laracasts/gulpfile.js
laravel: gulp config for laravel
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
@dariodiaz
dariodiaz / gulpfile.js
Created January 23, 2014 00:37 — forked from BradEstey/gulpfile.js
config php gulp: gulp config for phpunit tests
var gulp = require('gulp');
var sys = require('sys');
var exec = require('child_process').exec;
var hold = false;
gulp.task('phpunit', function() {
exec('phpunit', function(error, stdout) {
sys.puts(stdout);
hold = false;
});
@dariodiaz
dariodiaz / gulpfile.js
Created January 23, 2014 00:34 — forked from JeffreyWay/gulpfile.js
config: build task runner
var gulp = require('gulp');
var minifycss = require('gulp-minify-css');
var autoprefixer = require('gulp-autoprefixer');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
gulp.task('css', function() {
return gulp.src('sass/main.sass')
.pipe(sass({ style: 'compressed' }))
.pipe(autoprefixer('last 15 version'))
@dariodiaz
dariodiaz / 0) ABC for Sendy with Laravel
Created January 21, 2014 17:17 — forked from jasonlemay/0) ABC for Sendy with Laravel
laravel: send emails with sendy
Setting up Sendy with Laravel
(there might be bugs, I striped out some parts of my code because what I have is more complicated then that, so, sorry if it's broken!)
--
I would recommand creating a database for Sendy only.
Add Sendy's database into your database.php (1)
Create the Campaign model (2), and specify that you want to use Sendy's database (Campaigns are the only thing we really need to create, other things like creating lists can be done through Sendy interface, and there is a PHP library to add subscribers)
Now, it's time to install Sendy, usually somewhere like yourapp.com/sendy or yourapp.com/newsletter