Skip to content

Instantly share code, notes, and snippets.

View israteneda's full-sized avatar
👨‍💻
🎥✈🌏

Israel Teneda israteneda

👨‍💻
🎥✈🌏
View GitHub Profile
@israteneda
israteneda / upgrade.sh
Created June 1, 2018 19:03 — forked from artemsky/upgrade.sh
PHP 7.2 Cloud9
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
@israteneda
israteneda / gist:b323abca437b1bf8688352f3786a2252
Last active August 23, 2018 21:39
Install Laravel 5.6 on C9
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 / hexStringToByteArray.java
Last active March 7, 2019 17:06
Transform hex string to byte array
// 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;
@israteneda
israteneda / RepeatHandler.java
Created December 26, 2019 14:51
Repeating task with handler
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 / einvoice.py
Created October 9, 2023 04:15 — forked from alcidesrivera/einvoice.py
Electronic Document SRI Ecuador
# -*- coding: utf-8 -*-
##############################################################################
#
# E-Invoice Module - Ecuador
# Copyright (C) 2014 VIRTUALSAMI CIA. LTDA. All Rights Reserved
# alcides@virtualsami.com.ec
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by