Skip to content

Instantly share code, notes, and snippets.

@luisfc
luisfc / install nodejs, npm and gulp
Last active October 3, 2020 16:37
Install nodejs, npm and gulp ubuntu 16.04
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
## Use n module from npm in order to upgrade node
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
@luisfc
luisfc / __INDEX.txt
Created July 19, 2017 00:34 — forked from facine/__INDEX.txt
Drupal 8 - Examples
# Taxonomy terms:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php
# Menu links:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php
# File items:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php
# Nodes:
@luisfc
luisfc / Install MyCLI
Created June 13, 2017 20:04
Install MyCLI
MyCLI is a command line interface for MySQL, MariaDB, and Percona with auto-completion and syntax highlighting.
sudo apt-get install mycli
Used examples:
$ mycli local_database
$ mycli -h localhost -u root
@luisfc
luisfc / Install phpMyAdmin Ubuntu 16.04 and php7-fpm
Created June 13, 2017 19:34
Install phpMyAdmin Ubuntu 16.04 and php7-fpm
sudo apt update
sudo apt install phpmyadmin
This is a : no need to think setup for Ubuntu 16.04 with php7-fpm already installed.
Then copy paste just before the last } of the file the following block into /etc/nginx/sites-avaliable/default
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
From the man page:
--user=user_name, -u user_name
--password[=password], -p[password]
These work:
-uuser_name -ppassword
-u user_name -ppassword
@luisfc
luisfc / How To Install Nginx on Ubuntu 16.04
Created May 23, 2017 16:32
How To Install Nginx on Ubuntu 16.04
NGINX UBUNTU UBUNTU 16.04
Introduction
Nginx is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet. It is more resource-friendly than Apache in most cases and can be used as a web server or a reverse proxy.
In this guide, we'll discuss how to get Nginx installed on your Ubuntu 16.04 server.
Prerequisites
Before you begin this guide, you should have a regular, non-root user with sudo privileges configured on your server. You can learn how to configure a regular user account by following our initial server setup guide for Ubuntu 16.04.
@luisfc
luisfc / Switch PHP version
Last active May 23, 2017 04:58
Switch PHP version
From php5.6 to php7.0:
Apache:
sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart
CLI:
sudo update-alternatives --set php /usr/bin/php7.0
From php7.0 to php5.6:
Apache:
sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart
CLI:
sudo update-alternatives --set php /usr/bin/php5.6
//Iterate in Bundle
Bundle mBundle = data.getExtras();
for (String key : mBundle.keySet()) {
Log.e(key, mBundle.get(key).toString());
}
//Iterate in SharedPreferences
SharedPreferences myShPref = getSharedPreferences("mySharedPreferences", Context.MODE_PRIVATE);
package com.ethanf.in_app_billing_ex;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import com.android.vending.billing.IInAppBillingService;
import android.os.Bundle;
@luisfc
luisfc / MainActivity.java
Created April 24, 2017 19:11 — forked from first087/MainActivity.java
Android Application : In-app Billing Example with Utility. Test app at https://play.google.com/store/apps/details?id=com.ethanf.in_app_billing_ex2
package com.ethanf.in_app_billing_ex2;
import com.ethanf.in_app_billing_ex2.util.IabHelper;
import com.ethanf.in_app_billing_ex2.util.Inventory;
import com.ethanf.in_app_billing_ex2.util.IabResult;
import com.ethanf.in_app_billing_ex2.util.Purchase;
import com.ethanf.in_app_billing_ex2.util.SkuDetails;
import android.os.Bundle;
import android.app.Activity;