Skip to content

Instantly share code, notes, and snippets.

View EdwardNavarro's full-sized avatar
🎯
Focusing

Edward Navarro EdwardNavarro

🎯
Focusing
View GitHub Profile
### Starting from a Fresh CentOS 6.2 Linode
### Enable the native kernel to boot from pvgrub
### It will autoconfigure itself with each yum update.
### This is adapted from a previous script for CentOS 5.5 found here:
### http://library.linode.com/assets/542-centos5-native-kernel-selinux-enforcing.sh
### Provided via the linode wiki
### http://library.linode.com/linode-platform/custom-instances/pv-grub-howto#sph_centos-5
### Provided without warranty, although since it should only be run
### on first box build if your box gets broken simply rebuild it
//Send data to webView in Titanium
var timeGraph = Ti.UI.createWebView({ url:'graphs/timeGraph.html', touchEnabled:true });
timeGraph.addEventListener('load', function(){
Ti.App.fireEvent('graphCareer', series);
});
<!-- Receive data in webView -->
<script type="text/javascript">
@EdwardNavarro
EdwardNavarro / storage.js
Created March 24, 2018 22:18 — forked from rohozhnikoff/storage.js
[react-native] wrapped AsyncStorage with JSON support
import { AsyncStorage } from 'react-native';
const JSONAsyncStorage = Object.assign({}, AsyncStorage, {
getItem() {
return AsyncStorage.getItem.apply(null, arguments).then((res) => JSON.parse(res));
},
setItem(key, value) {
return AsyncStorage.setItem(key, JSON.stringify(value))
}
});
@EdwardNavarro
EdwardNavarro / 1_google_cloud_storage_backup_tutorial.md
Created July 21, 2018 03:34 — forked from rnwolf/1_google_cloud_storage_backup_tutorial.md
Tutorial shows how to make backups to Google Cloud Storage.

Google Cloud Storage backup tutorial

Introduction

This tutorial shows how to make backups to Google Cloud Storage. The backups are:

  • automatic
  • stored off site
  • incremental
<?php
function contactform7_before_send_mail( $form_to_DB ) {
global $wpdb;
$form_to_DB = WPCF7_Submission::get_instance();
if ( $form_to_DB )
$formData = $form_to_DB->get_posted_data();
@EdwardNavarro
EdwardNavarro / TrmSoapClient.php
Created March 27, 2019 03:56 — forked from cdiaz/TrmSoapClient.php
Obtener la tasa de cambio representativa del mercado para Colombia con PHP
<?php
$date = date("Y-m-d");
try {
$soap = new soapclient("https://www.superfinanciera.gov.co/SuperfinancieraWebServiceTRM/TCRMServicesWebService/TCRMServicesWebService?WSDL", array(
'soap_version' => SOAP_1_1,
'trace' => 1,
"location" => "http://www.superfinanciera.gov.co/SuperfinancieraWebServiceTRM/TCRMServicesWebService/TCRMServicesWebService",
));
@EdwardNavarro
EdwardNavarro / ConsultaNitRUES.js
Created March 27, 2019 03:57 — forked from cdiaz/ConsultaNitRUES.js
Consulta NIT en el Registro Único Empresarial y Social (RUES)
var request = require('request');
// Digite el NIT sin puntos ni guiones, el dígito de Verificación no es requerido.
request.post(
'http://www.rues.org.co/RUES_Web/Consultas/ConsultaNIT_json',
{ form: {strNIT: '891190346' } },
function (error, response, result) {
if (!error && response.statusCode == 200) {
console.log(result)
@EdwardNavarro
EdwardNavarro / TrmSoapClient.py
Created March 27, 2019 03:57 — forked from cdiaz/TrmSoapClient.py
Obtener La tasa de cambio representativa del mercado (TRM) para Colombia consumiendo el webservice de la Superintentencia Financiera desde Python
#!/usr/bin/env python
from suds.client import Client
import time
WSDL_URL = 'https://www.superfinanciera.gov.co/SuperfinancieraWebServiceTRM/TCRMServicesWebService/TCRMServicesWebService?WSDL'
date = time.strftime('%Y-%m-%d')
def trm(date):
try:
client = Client(WSDL_URL, location=WSDL_URL, faults=True)
@EdwardNavarro
EdwardNavarro / ascii_arty.py
Created May 14, 2019 21:57 — forked from jdiaz5513/ascii_arty.py
Console ASCII Art Generator
#! /usr/bin/env python2
# Requires: PIL, colormath
#
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_conversions import convert_color
from colormath.color_objects import LabColor
from colormath.color_objects import sRGBColor as RGBColor
@EdwardNavarro
EdwardNavarro / gist:16327a0117b85ac10c6c421cd217d7a7
Created May 18, 2019 16:53 — forked from johnmorris/gist:8135167
A simple database class using mysqli prepared statements in PHP.
<?php
if ( !class_exists( 'DB' ) ) {
class DB {
public function __construct($user, $password, $database, $host = 'localhost') {
$this->user = $user;
$this->password = $password;
$this->database = $database;
$this->host = $host;
}
protected function connect() {