Skip to content

Instantly share code, notes, and snippets.

View thethomaseffect's full-sized avatar

Thomas Geraghty thethomaseffect

View GitHub Profile
/*
Paste into console to get rid of annoying facebook login prompt on TOM
news articles. If you make a userscript for this remember to wrap this
in a document.onReady block.
*/
document.getElementById("modal-fb_login").style.display = 'none';

Python Number Conversion Chart

From To Expression
@thethomaseffect
thethomaseffect / MaouConverter.py
Created May 6, 2013 01:48
A command-line converter from English to the language used by characters in the anime "Hataraku Maō-sama" in one line of code because I wanted to show off.
# MaouTranslator.py
print (str.lower(input("Enter English text to be translated: ")).translate(str.maketrans("abcdefghijklmnopqrstuvwxyz","azyxewvtisrlpnomqkjhugfdcb")))
@thethomaseffect
thethomaseffect / csharp_in_powershell.ps1
Created October 11, 2013 12:26
C# in Powershell Scripts
$Source = @"
namespace CSharpPSTest
{
public static class PSTest
{
private static string _result = "Default Value";
public static string Get()
{
return "Get Success: " + _result;
}
@thethomaseffect
thethomaseffect / FunctionalCSharp.cs
Created October 21, 2013 15:45
Simple functional C# example
using System;
using Person = System.Tuple<string,string,int>;
namespace FunctionalCsharpExample
{
class FunctionalCSharp
{
static string CompareAge(Person a, Person b)
{
if (a.Item3 == b.Item3)
@thethomaseffect
thethomaseffect / OOCSharp.cs
Created October 21, 2013 15:45
Simple OOP example in C#
using System;
namespace OOCSharpExample
{
internal class OOCSharp
{
private static void Main(string[] args)
{
var person1 = new Person("Thomas", "Dublin", 23);
var person2 = new Person("John", "Sligo", 22);
@thethomaseffect
thethomaseffect / sample.go
Created October 21, 2013 16:03
Simple Go Example
package main
import "fmt"
type Person struct {
name string
}
func (p Person) GetName() string {
return p.name
@thethomaseffect
thethomaseffect / simple_tree.ts
Last active January 2, 2016 18:29
Simple tree implementation in TypeScript using only a single one-line function. It's obviously seriously basic and insert/delete operations would not be very efficient but then again your data is immutable so who needs to do that right? ;)
function N(...nodes:any[]) {
return nodes;
}
var tree =
N("root",
N("one", "one",
N("two", "two")),
N("one", "one",
N("two")));

Keybase proof

I hereby claim:

  • I am thethomaseffect on github.
  • I am thethomaseffect (https://keybase.io/thethomaseffect) on keybase.
  • I have a public key whose fingerprint is CD0B A480 AE01 6163 6044 0A80 AD95 3FCF 4876 6E39

To claim this, I am signing this object:

@thethomaseffect
thethomaseffect / XIVAnalysisOpenButton.user.js
Created August 26, 2019 15:26
Adds a button in the top right to open the currently open log in XIVAnalysis
// ==UserScript==
// @name Open XIVAnalysis from FFLogs
// @namespace http://fflogs.com/
// @version 0.1
// @description Adds a button in the top right to open the currently open log in XIVAnalysis
// @author thethomaseffect#8330 Frank Reynolds (Phoenix)
// @match https://www.fflogs.com/reports/*
// @grant none
// ==/UserScript==