Skip to content

Instantly share code, notes, and snippets.

#disable xdebug on vagrant
sudo php5dismod xdebug
#enable xdebug on vagrant
sudo php5enmod xdebug
# restart apache
sudo service apache2 restart
if [ -f /swapfile ]; then
echo "The Swap file already exists."
else
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab'
sudo sh -c 'echo "vm.swappiness = 10" >> /etc/sysctl.conf' # 60 for desktops, closer to 0 for VPS (10?)
sudo sh -c 'echo "vm.vfs_cache_pressure = 50" >> /etc/sysctl.conf'
{
    "body": {
        "key": {
            "eldest_kid": "01011cfcdfa7fa75b1eb3d2975496712b8a5eed771265410c9ad1564ae7c4bf42ae30a",
            "host": "keybase.io",
            "kid": "0120a17480b5939cede66f957b5555f1a71ea44f6c516b2275b82ea4573132a7c2a10a",
            "uid": "4fed4a5cb3b3651c24b2417a58eed919",
            "username": "tr0n"
        },
@tonioriol
tonioriol / git_delete_merged.sh
Last active May 19, 2016 08:34
git cleanup merged branches
############################################################################
# DELETE ALL BRANCHES THAT ALREADY ARE MERGED INTO MASTER (except develop) #
############################################################################
# @source: http://stackoverflow.com/a/18143078/1126075
# 1. checkout
git checkout master
# 2. echo all remote branches merged into origin/master except origin/master and origin/develop
@tonioriol
tonioriol / selectLinkedinImportedContacts.js
Last active August 29, 2015 14:03
Snippet of jQuery code to select the first 99 LinkedIn imported contacts for deleting them. Because LinkedIn don't provide any way to select multiple contacts.
$('.vcard input').each(function (i) {
if(i < 99) {
$(this).trigger('click');
}
});
@tonioriol
tonioriol / gist:7252745
Created October 31, 2013 16:31
Changes the opacity of the element with fade
/**
* Changes the opacity of the element with fade
* --------------------------------------------
* var mode : is string and can be 'in' or 'out'
* var time : the time of the fade in milliseconds
* var elementId : the id of the element
* var finalOpacity : de opacity we want at the end of the process, because sometimes we don't want full transparency or opacity
*/
function fade (mode, elementId, time, finalOpacity) {
/* trick for setting a default value, just in case we don't set any value on the function call */
@tonioriol
tonioriol / gist:3880371
Created October 12, 2012 17:26
Add New Source to Feedly bookmarklet
javascript:
var elements = document.getElementsByTagName('link');
var feeds = [];
for (var i = 0; i < elements.length; ++i) {
if (elements[i].type == 'application/rss+xml' || elements[i].type == 'application/atom+xml') {
var aux = [];
aux['href'] = 'http://www.feedly.com/home#subscription/feed/' + elements[i].href;
aux['title'] = elements[i].title == '' ? 'Feed' : elements[i].title;