Skip to content

Instantly share code, notes, and snippets.

View txusko's full-sized avatar

Javi Filella txusko

View GitHub Profile
@txusko
txusko / keybase.md
Last active October 11, 2019 21:31

Keybase proof

I hereby claim:

  • I am txusko on github.
  • I am txusko (https://keybase.io/txusko) on keybase.
  • I have a public key ASC_Znds2riay8oX9oZsI6v49JaQG3OU-KC4GziZqKj5qAo

To claim this, I am signing this object:

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@txusko
txusko / lastfmDeleteScrobbles.js
Created February 15, 2017 07:31
Last.fm: javascript hack to emulate the click action on the delete button of all the scrobbled elements in a page. You should be logged in. Example page: http://www.last.fm/user/YOUR_USER/library
document.querySelectorAll('.chartlist-delete-button').forEach(function(elemento) {
elemento.click();
});
@txusko
txusko / wintips.cs
Created January 7, 2014 12:11
Windows tips
//¿Como saber que programa te esta abriendo un puerto?
c:\>netstat -ano |find /i ":PUERTO"
c:\>tasklist |find /i "PID"
//¿Como matar un proceso con el PID?
c:\>taskkill /PID "PID"
//¿Como matar un proceso con el nombre del proceso?
c:\>taskill /IM algo.exe //(con -F fuerzas)
@txusko
txusko / increaseString.cs
Created December 30, 2013 16:22
Incrementa el string tcCodigo Ej. string lastCodigo = IncrementXLColumn("AA"); -> Devolvera lastCodigo = "AB";
/// <summary>
/// Incrementa el string tcCodigo
/// Ej. string lastCodigo = IncrementXLColumn("AA"); -> Devolvera lastCodigo = "AB";
/// </summary>
/// <param name="tcCodigo"></param>
/// <returns></returns>
protected static string IncrementXLColumn(string tcCodigo)
{
//var parts = System.Text.RegularExpressions.Regex.Matches(Address, @"([A-Z]+)|(\d+)");
var lParts = System.Text.RegularExpressions.Regex.Matches(tcCodigo, @"([A-Z])|([A-Z])");
@txusko
txusko / checkadministrator.cs
Created December 20, 2013 10:55
Checks to see if the current user is an Administrator.
bool IsAnAdministrator ()
{
WindowsIdentity identity = WindowsIdentity.GetCurrent();
WindowsPrincipal principal = new WindowsPrincipal (identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
}