Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
🎥🌏

Israel Teneda israteneda

👨‍💻
🎥🌏
View GitHub Profile
@israteneda
israteneda / RepeatHandler.java
Created Dec 26, 2019
Repeating task with handler
View RepeatHandler.java
private int mInterval = 5000; // 5 seconds by default, can be changed later
private Handler mHandler;
@Override
protected void onCreate(Bundle bundle) {
// your code here
mHandler = new Handler();
startRepeatingTask();
@israteneda
israteneda / hexStringToByteArray.java
Last active Mar 7, 2019
Transform hex string to byte array
View hexStringToByteArray.java
// Transform hexadecimal String example
public byte[] hexStringToByteArray(String s) {
byte[] data;
int len = s.length();
data = new byte[len / 2];
for (int i = 0; i < len; i += 2) {
data[i / 2] = (byte) ((Character.digit( s.charAt( i ), 16 ) << 4)
+ Character.digit( s.charAt( i + 1 ), 16 ));
}
return data;
View gist:b323abca437b1bf8688352f3786a2252
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install php7.2 php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml
sudo apt-get install libapache2-mod-php7.2 -y
sudo a2dismod php5
sudo a2enmod php7.2
sudo service apache2 restart
sudo composer self-update
@israteneda
israteneda / upgrade.sh
Created Jun 1, 2018 — forked from artemsky/upgrade.sh
PHP 7.2 Cloud9
View upgrade.sh
sudo apt-get install python-software-properties -y
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install php7.2 php-pear php7.2-curl php7.2-dev php7.2-gd php7.2-mbstring php7.2-zip php7.2-mysql php7.2-xml
sudo apt-get install libapache2-mod-php7.2 -y
sudo a2dismod php5
sudo a2enmod php7.2
sudo service apache2 restart