Skip to content

Instantly share code, notes, and snippets.

View sirviejo's full-sized avatar

Lautaro Eduardo Rosales sirviejo

View GitHub Profile
@sirviejo
sirviejo / globant-news.css
Created February 18, 2016 01:52
Globant Investors News Iphone Fix
@media only screen
and (max-device-width: 640px),
only screen and (max-device-width: 667px),
only screen and (max-width: 480px)
{
.wd_newsfeed_releases .wd_item_wrapper {
float: none;
margin-left: 0;
clear: both
@sirviejo
sirviejo / gist:8824440
Created February 5, 2014 14:16
Wordpress - wp_list_categories Remove title attributes without touching core files
$subcategories = wp_list_categories( $subcat_args );
$subcategories = preg_replace('/title="([^"]+)"/', 'title=""', $subcategories);
@sirviejo
sirviejo / gist:6831879
Created October 4, 2013 20:00
PHP: Flush Buffers
function flush_buffers(){
ob_end_flush();
flush();
ob_start();
}
@sirviejo
sirviejo / gist:5004751
Created February 21, 2013 13:33
Create a Drupal user programatically
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
$account->name = 'user_name';
$account->pass = user_hash_password('password_string');
$account->mail = 'user@mail.com';
$account->status = 1;
// Add Role with rid 3 to this user
$roles = array('3' => true);
$account->roles = $roles;
$user = user_save($account);