Skip to content

Instantly share code, notes, and snippets.

View kabeza's full-sized avatar

Enrique Becerra kabeza

View GitHub Profile
@jbonney
jbonney / spotify_keybindings
Created June 9, 2013 13:22
Spotify - Linux key bindings. From XFCE / Ubuntu keyboard shortcuts configuration, assign the control command to their key. http://shkspr.mobi/blog/2011/12/linux-spotify-keybindings/
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious
@sareiodata
sareiodata / empty-wp-plugin.php
Created July 2, 2014 08:45
Empty WordPress plugin
<?php
/**
* Plugin Name: Name Of The Plugin
* Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
* Description: A brief description of the Plugin.
* Version: The Plugin's Version Number, e.g.: 1.0
* Author: Name Of The Plugin Author
* Author URI: http://URI_Of_The_Plugin_Author
* License: A "Slug" license name e.g. GPL2
*/
@JustThomas
JustThomas / wordpress-multisite-internal-redirect-loop.md
Last active October 9, 2024 00:00
WordPress Multisite: How to fix error "too many redirects"

WordPress Multisite: How to fix error "Request exceeded the limit of 10 internal redirects"

I am running a WordPress multisite network with sub-directory setup. When I check my error.log file, it is full of entries like this one:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'Limit InternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

The problem was, in my case, one specific rewrite rule in the .htaccess file.

Problem description

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
@jacricelli
jacricelli / cuilt.php
Created February 13, 2017 15:26
Generar / Validar CUILT
<?php
public function generarCuilt($dni, $sexo)
{
if (!empty($dni)) {
$dni = (string)$dni;
$prefix = $sexo === 'F' ? '27' : '20';
$sum = ($prefix[0] * 5) + ($prefix[1] * 4);
foreach ([3, 2, 7, 6, 5, 4, 3, 2] as $key => $value) {
$sum += (int)$dni[$key] * $value;
@dharavp
dharavp / react-native project upload on git
Last active April 19, 2024 13:58
This Document is include to upload react-native project on github in ubantu
Upload React Native Project on Git
Step:1 Create Repository in Git Account
Step:2 Go Into the Folder of your project
Step:3 Initialize git
-> git init
@rtoscani
rtoscani / scriptable-dollar-blue.js
Created January 17, 2023 19:14
Dollar Blue price widget for use on scriptable
const url = `https://api.bluelytics.com.ar/v2/latest`;
const req = new Request(url);
const res = await req.loadJSON();
const sellAmount = res.blue.value_sell;
const buyAmount = res.blue.value_buy;
const i = new Request('https://icons.iconarchive.com/icons/designcontest/ecommerce-business/256/money-icon.png');
const img = await i.loadImage();
let widget = createWidget(buyAmount, sellAmount, img);