Skip to content

Instantly share code, notes, and snippets.

View ilopez's full-sized avatar

Israel Lopez ilopez

View GitHub Profile
@ilopez
ilopez / fishbowl_database_test.cs
Created February 14, 2017 23:52
Test Firebird and MySQL Connection
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using FirebirdSql.Data.FirebirdClient;
using MySql.Data.MySqlClient;
<font size="14" weight="bold">EasyPost Rating Estimate</font>
<br><br>
<p>Sales Order: 50005</p>
<pre>
Carrier Service Speed Rate
UPS Ground 3-5 Days $20.00
UPS Ground 3-5 Days $20.00
@ilopez
ilopez / Resource.Designer.cs
Created April 1, 2016 04:16
Regenerated Xamarin Forms Resource Designer CS - Visual Studio 2015
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ilopez
ilopez / Resource.Designer.cs
Created April 1, 2016 04:00
New Xamarin Forms Universal App in Visual Studio 2015
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ilopez
ilopez / gson-unirest.java
Created March 25, 2016 15:54
Using Gson with Unirest
Unirest.setObjectMapper(new ObjectMapper() {
private Gson gson = new Gson();
public <T> T readValue(String s, Class<T> aClass) {
try{
return gson.fromJson(s, aClass);
}catch(Exception e){
throw new RuntimeException(e);
}
}
@ilopez
ilopez / KRestClient.cs
Created December 19, 2015 21:56
Implementing Exponential Backoff in RestSharp for Execute<T> Method
public class KRestClient : RestClient
{
public Int32 RequestRetryCount = 5; // Attempt Types
public Int32 BackoffRate = 100; // Milliseconds
public KRestClient(string baseUrl) : base(baseUrl)
{
}
public override IRestResponse<T> Execute<T>(IRestRequest request)
select
part.num,
part.description,
SUM(tag.qty) as qoh,
SUM(tag.qtycommitted) as qtycmtd
from part
join tag on tag.partid = part.id
where part.activeflag = 0
and part.id > 0
group by 1,2
@ilopez
ilopez / BLOB not found
Last active August 29, 2015 14:14
Firebird BLOB Errors in 2.5.3.26778
Starting Against Test DB: Z:\temp\TESTDB.FDB sysdba masterkey
Enter to Start
Dropping Database
Creating Database
Applying Schema
Records Written: 1
Simulating a Close
Operation requires an open and available connection.
Stopped... Press Enter to Check for Validation.
@ilopez
ilopez / SO22141769.jrxml
Created March 5, 2014 15:47
JasperReports Locale Formatting Patterns
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="SO22141769" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="5dec3fda-cd33-4882-bba3-15f2a3bd0869">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<queryString>
<![CDATA[select CAST('now' as timestamp) as ts, CAST('127647853.233' as double precision) as num from rdb$database]]>
</queryString>
<field name="TS" class="java.sql.Timestamp"/>
<field name="NUM" class="java.lang.Double"/>
@ilopez
ilopez / AndroidManifest.xml
Created July 20, 2013 20:20
Recording Activity Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ilopez.android.troubleshooter"
android:versionCode="1"
android:versionName="1.0"
>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />