Skip to content

Instantly share code, notes, and snippets.

View pachecoder's full-sized avatar

Jorge Pacheco pachecoder

  • Buenos Aires, Argentina
View GitHub Profile
View ModifyConnectionstring.cs
public void ChangeConnectionString(string key)
{
var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
var connectionStringsSection = (ConnectionStringsSection)config.GetSection("connectionStrings");
var value = connectionStringsSection.ConnectionStrings[key];
connectionStringsSection.ConnectionStrings[key].ConnectionString = ConnectionString;
config.Save(ConfigurationSaveMode.Modified, true);
ConfigurationManager.RefreshSection("connectionStrings");
}
@pachecoder
pachecoder / chiguibot.py
Created August 8, 2016 17:06
Bot para leer y publicar los enlaces al Chiguire Bipolar en Reddit
View chiguibot.py
#!/usr/bin/env python
import praw
import json
import OAuth2Util
import requests
import re
from lxml.cssselect import CSSSelector
import lxml.html
def check_none_type_object(obj):
@pachecoder
pachecoder / mysql-backup-windows.bat
Last active September 19, 2015 11:20 — forked from sindresorhus/mysql-backup-windows.bat
Backup MySQL databases in separate gzipped sql files on Windows
View mysql-backup-windows.bat
@echo off
set dbUser=root
set dbPassword=yourPassword
set backupDir="C:\Documents and Settings\user\Desktop\backup\mysql"
set mysqldump="C:\Program Files\MySQL\MySQL Workbench 5.2 CE\mysqldump.exe"
set mysqlDataDir="C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data"
set zip="C:\Program Files\7-Zip\7z.exe"
::Change date delimiter to -
View keybase.md

Keybase proof

I hereby claim:

  • I am pachecoder on github.
  • I am pachecogeorge (https://keybase.io/pachecogeorge) on keybase.
  • I have a public key whose fingerprint is D4D1 355D A107 4FE1 08EF 2A91 FA95 2217 7BC4 8915

To claim this, I am signing this object:

@pachecoder
pachecoder / JsonGetTimeCCS
Created March 25, 2014 13:33
URL que retorna en formato JSON la hora de una Zona Horaria en este caso CCS
View JsonGetTimeCCS
http://json-time.appspot.com/time.json?tz=America/Caracas&callback=HoraMundial
@pachecoder
pachecoder / GitConfigColorAuto.sh
Created March 12, 2014 15:29
configure the color.ui from git console
View GitConfigColorAuto.sh
#!/bin/sh
#configure the color.ui from git console in ubuntu.
#DOC: http://git-scm.com/book/en/Customizing-Git-Git-Configuration
git config --global color.ui = always
@pachecoder
pachecoder / GetLocalIpAddress.cs
Created January 28, 2014 15:41
Get the local ip address of the principal network adapter card.
View GetLocalIpAddress.cs
public string getLocalIPAddress()
{
IPHostEntry host;
string localIP = "";
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
localIP = ip.ToString();
@pachecoder
pachecoder / GetLocalNetworkSqlInstances.cs
Created November 29, 2013 19:09
Get all local network sql instances.
View GetLocalNetworkSqlInstances.cs
//using System.Data.Sql;
public List<string> GetLocalNetworkSqlInstances()
{
SqlDataSourceEnumerator instances = SqlDataSourceEnumerator.Instance;
List<string> listInstance = new List<string>();
DataTable dt = instances.GetDataSources();
listInstance.Clear();
@pachecoder
pachecoder / GetDbTypeFromType.cs
Last active December 29, 2015 08:09
Parse Type in DbType
View GetDbTypeFromType.cs
public DbType GetDbType(Type type)
{
DbType dbType = (DbType)Enum.Parse(typeof(DbType), type.Name);
return dbType;
}
@pachecoder
pachecoder / validateDecimalToInt.cs
Last active December 24, 2015 16:28
Valida que el decimal sea entero con la finalidad de realizar una validacion. Validate Decimal value is Int.
View validateDecimalToInt.cs
public static void Main (string[] args)
{
decimal d = 3.1M;
Console.WriteLine((d % 1) == 0);
d = 3.0M;
Console.WriteLine((d % 1) == 0);
}