Skip to content

Instantly share code, notes, and snippets.

View degt's full-sized avatar
⛱️
Le vent se lève, il faut tenter de vivre.

Daniel Gutiérrez degt

⛱️
Le vent se lève, il faut tenter de vivre.
View GitHub Profile
#run php server from terminal
sudo php -S <domain>:<port>
@degt
degt / Laravel 4.sh
Last active December 17, 2015 03:48
//Install laravel 4
git clone -b develop git://github.com/laravel/laravel.git .
//Run Server
//sudo php -S domain.dev:80
sudo php -S domain.dev:80 -t public/
php artisan serve
//Exec autoload
composer dump-auto
@degt
degt / database.php
Created June 3, 2013 00:23
MAMP laravel database config
<?php
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'database',
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
//
// NSMutableDictionary+Utilities.h
//
// Created by Daniel Gutierrez on 11/26/13.
//
#import <Foundation/Foundation.h>
@interface NSMutableDictionary (Utilities)
@degt
degt / Gruntfile.js
Last active February 5, 2016 14:20
Gruntjs workflow
module.exports = function(grunt) {
// set up grunt
};
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@degt
degt / functions.php
Last active August 29, 2015 14:02
Wordpress Pagination - Bootstrap style
<?php
//Custom pagination
function wp_bootstrap_pagination()
{
global $wp_query;
$big = 999999999;
$current = max(1, get_query_var('paged'));
$paginate = paginate_links(array(
@degt
degt / gist:b0c800c4b32957755097
Created June 28, 2014 04:59
url2pin - bookmarklet
javascript:(function(){ window.open('http://url2pin.it/'+window.location.host+window.location.pathname, 'http://url2pin.it/');})();
@degt
degt / routes.php
Created July 31, 2014 04:56
Route patterns in Laravel
<?php
//http://markvaneijk.com/route-patterns-in-laravel
Route::pattern('id', '[0-9]+');
Route::pattern('hash', '[a-z0-9]{32}');
Route::pattern('slug', '[a-z0-9-]+');
Route::pattern('username', '[a-z0-9-]{3,20}');
$.fn.preload = function() {
this.each(function(){
$('<img/>')[0].src = this;
});
}
// Usage:
$(['img1.jpg','img2.jpg','img3.jpg']).preload();