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
<?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();
<?php
try
{
$user = Sentry::authenticate($credentials, false);
if ($user)
{
return Redirect::route('admin.pages.index');
}
<?php
// Facebook Open Graph
add_action('wp_head', 'add_fb_open_graph_tags');
function add_fb_open_graph_tags() {
if (is_single()) {
global $post;
if(get_the_post_thumbnail($post->ID, 'thumbnail')) {
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_object = get_post($thumbnail_id);
@degt
degt / globals_functions_edge.js
Created February 16, 2015 15:38
Edge globals functions
Symbol.bindSymbolAction(compId, symbolName, "creationComplete", function(sym, e) {
sym.globalFunction = function(){
// statements
console.log("do something");
}
});
//To call this function from another symbol :
sym.getComposition().getStage().globalFunction();
@degt
degt / gist:5fa003461c6a7c3a8312
Created March 17, 2015 20:33
Force delete the directory from Git
git rm -rf <directory_name>
rsync -a --progress <folder> <target>