Skip to content

Instantly share code, notes, and snippets.

View fboiton's full-sized avatar

Fernandojosé Boiton fboiton

  • Guatemala
  • 13:30 (UTC -06:00)
View GitHub Profile
@fboiton
fboiton / gist:1000941
Created May 31, 2011 17:39
extract svn revision files
#!/bin/bash
if [ $# -lt 4 ]; then
echo "This script needs 4 parameters as follows:"
echo "./getFilesToUpload.sh [root svn path] [internal svn path] [revision(s) - ARG1:ARG2 for ranges] [output folder]"
exit 0
fi
ROOTSVNPATH=$1
INTERNALSVNPATH=$2
REVISIONS=$3
@fboiton
fboiton / gist:946852
Created April 28, 2011 17:46
dictionary from csv string
public interface IXmlToDictionary<T,TK>
{
T this[TK key] { get; }
}
public class DynamicTransformationParams : IXmlToDictionary<string,string>
{
private readonly string _keyValueText;
@fboiton
fboiton / gist:873675
Created March 17, 2011 01:12
simple objects testing with java
class jugador{
int puntos;
}
class hw
{
public static void test(jugador j){
j.puntos = j.puntos + 3;
}
public static void main(String args[])
@fboiton
fboiton / gist:794223
Created January 24, 2011 23:43
simple DAO with Entlib DAAB
public class ListingsGridDao{
private const string QueryListings = "query with parameters @advertiserId";
private const string QueryReportListings = "query with parameters @advertiserId, @startDate, @endDate";
public IEnumerable<Listing> GetListings(int advertiserId){
var db = DatabaseFactory.CreateDatabase(ConfigurationManager.AppSettings["DBReportsCRUD"]);
List<Listing> result = new List<Listing>();
using(var cmd = db.GetSqlStringCommand(QueryListings)){
db.AddInParameter(cmd, "@advertiserId", DbType.Int,advertiserId );
using(var reader = db.ExecuteReader(cmd)){
@fboiton
fboiton / gist:788219
Created January 20, 2011 17:22
Custom Dictionary to get formatted values based on specific values and rules
using System;
using System.Collections.Generic;
namespace CustomDictionary {
public interface IGenericDictionarySB<T, TK> {
T this[TK key] { get; set; }
}
public class SuperBidParameters : IGenericDictionarySB<string,string> {
private string _ageDriver;
public static class ListingTriggers
{
[SqlTrigger(Name = "trig_listingmodified",
Target = "ppc_t_account_profile",
Event = "FOR INSERT, DELETE, UPDATE")]
public static void WhenListingModified()
{
var context = SqlContext.TriggerContext;
var builder = new ListingCommandBuilder();
if (context.TriggerAction != TriggerAction.Insert
@fboiton
fboiton / gist:572499
Created September 9, 2010 20:31
refactoring option fboiton
using Microsoft.SqlServer.Server;
using System.Data.SqlClient;
namespace BrokersWeb.Synchronization.SqlServer.Listings
{
public static class ListingTriggers
{
[SqlTrigger(Name = "trig_listingmodified",
Target = "ppc_t_account_profile",
Event = "FOR INSERT, DELETE, UPDATE")]
string strAcctPauseNote = "paused by the System because Balance is " + string.Format("{0:c2}", dAcctBalance);