Skip to content

Instantly share code, notes, and snippets.

View webarthur's full-sized avatar
✌️

Arthur Ronconi webarthur

✌️
View GitHub Profile
@webarthur
webarthur / Sublime 3 on Ubuntu
Created October 27, 2015 01:37
Sublime 3 on Ubuntu/Xubuntu
sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installe
sudo add-apt-repository ppa:webupd8team/atom
sudo apt-get update
sudo apt-get install atom
@webarthur
webarthur / demo.sql
Created October 27, 2015 14:43
Insert a Demo Admin user in WordPress Database
INSERT INTO `wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('666', 'demo', MD5('demo'), 'Demo', 'test@yourdomain.com', 'http://www.test.com/', '2006-06-06 00:00:00', '', '0', 'Demo');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '666', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '666', 'wp_user_level', '10');
@webarthur
webarthur / multisite-wp
Last active November 15, 2017 06:24
Very easy way to run WordPress multisite on localhost!
# wp-config.php
define('DOMAIN_CURRENT_SITE', 'localhost:8081');
# $wpdb->blogs
domain=localhost:8081
path=/
# terminal
sudo php -S localhost:8081 -t /var/www/html/centro-europeu
# add user webarthur
adduser webarthur
# add git group
addgroup git
# add user to group
usermod -a -G git webarthur
sudo apt-get install nautilus-dropbox
cd && wget -O - "http://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
~/.dropbox-dist/dropboxd
# thunar plugin
sudo add-apt-repository ppa:xubuntu-dev/extras
sudo apt-get update
sudo apt-get install thunar-dropbox-plugin
@webarthur
webarthur / CVS content using PHP to variable
Last active January 19, 2016 14:48
How to create CVS content using PHP and write it to variable
<?php
$handle = fopen('php://memory', 'w');
$data = array('value 1', 20, 'text value', '0');
fputcsv($handle, $data, ';');
/* to be able to read from a handle, it is necessary to reset internal file pointer to the begining */
fseek($handle, 0);
$csv = stream_get_contents($handle);
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-org
$ mongo
> db.getSiblingDB('new_db').addUser('user', 'pass');
@webarthur
webarthur / get_youtube_channel_ID.php
Created April 11, 2016 21:46
Get youtube Channel ID by channel url
<?php
function get_youtube_channel_ID($url){
$html = file_get_contents($url);
preg_match("'<meta itemprop=\"channelId\" content=\"(.*?)\"'si", $html, $match);
if($match && $match[1]);
return $match[1];
}