Skip to content

Instantly share code, notes, and snippets.

⛱️
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
View wp-config.php
<?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 Aug 29, 2015
Wordpress Pagination - Bootstrap style
View functions.php
<?php
//Custom pagination
function wp_bootstrap_pagination()
{
global $wp_query;
$big = 999999999;
$current = max(1, get_query_var('paged'));
$paginate = paginate_links(array(
View gist:b0c800c4b32957755097
javascript:(function(){ window.open('http://url2pin.it/'+window.location.host+window.location.pathname, 'http://url2pin.it/');})();
@degt
degt / routes.php
Created Jul 31, 2014
Route patterns in Laravel
View routes.php
<?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}');
View images-preload.js
$.fn.preload = function() {
this.each(function(){
$('<img/>')[0].src = this;
});
}
// Usage:
$(['img1.jpg','img2.jpg','img3.jpg']).preload();
View SentryExceptionHandler.php
<?php
try
{
$user = Sentry::authenticate($credentials, false);
if ($user)
{
return Redirect::route('admin.pages.index');
}
View functions.php
<?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 Feb 16, 2015
Edge globals functions
View globals_functions_edge.js
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 Mar 17, 2015
Force delete the directory from Git
View gist:5fa003461c6a7c3a8312
git rm -rf <directory_name>
You can’t perform that action at this time.