Skip to content

Instantly share code, notes, and snippets.

View webarthur's full-sized avatar
✌️

Arthur Ronconi webarthur

✌️
View GitHub Profile
@webarthur
webarthur / sass.sh
Created September 18, 2015 13:14
How to use SASS / SCSS + PHP
# install ruby and gem
sudo apt-get install ruby gem
# install sass / scss
sudo gem install sass
# compile sass scripts
sass --watch scss/style.sass:css/style.css
# or compile scss scripts
# download installer
composer global require "laravel/installer=~1.1"
#setting up path
export PATH="~/.composer/vendor/bin:$PATH"
# change dir where to install
cd /var/www/html/
# download and installing
# system installation
sudo npm install -g bower
# laravel installation
bower init
# configure to laravel
# create .bowerrc file
# write:
# add this to your composer.json :
"laravelcollective/html": "~5.0"
# then update composer:
composer update
# then add providers in config/app.php
'Collective\Html\HtmlServiceProvider',
# and finally add two aliases in the same file:
@webarthur
webarthur / wp.composer.json
Created October 21, 2015 16:44
Easy way to install WordPress and plugins with Composer
{
"repositories": [
{
"type": "composer",
"url": "http://wpackagist.org"
}
],
"require": {
"php": ">=5.4",
"johnpbloch/wordpress": "*"
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');
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