Skip to content

Instantly share code, notes, and snippets.

View jleclanche's full-sized avatar
⛸️

Jerome Leclanche jleclanche

⛸️
View GitHub Profile
@jleclanche
jleclanche / d3
Last active August 29, 2015 13:57
Style improvements etc
#!/usr/bin/env python
import json
import sys
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
input = raw_input
@jleclanche
jleclanche / gist:9533710
Created March 13, 2014 18:13
Get plaintext patchnotes from the command line
function patchnotes {
ua="Battle.net/1.0.8.4217"
_baseurl="https://us.battle.net/connect/en/app"
usage="usage: $0 <product> [live|ptr|beta]\nproduct is one of wow, s2, d3, wtcg"
hash lynx 2>/dev/null || {
echo "You need to install Lynx first."
return 1
}
@jleclanche
jleclanche / update-tags.sh
Created May 1, 2014 18:16
Update tags to match their commit time
#!/bin/zsh
for tag in $(git tag); do
export GIT_AUTHOR_DATE="$(git log -1 --pretty=%ct $tag)"
export GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE
git tag -fam "Release v$tag" $tag $tag
done
function twitch {
if [[ $1 == "--check" ]]; then
streams=("day9tv" "totalbiscuit" "trumpsc" "noxious_hs")
for s in $streams; do
offline=$(curl --silent "https://api.twitch.tv/kraken/streams/$s/" | grep '"stream":null')
if [[ $offline == "" ]]; then
echo "$s is online"
fi
done
return
#!/usr/bin/env python
import json
import logging
import os
import re
import string
import sys
import requests
from datetime import datetime

Keybase proof

I hereby claim:

  • I am jleclanche on github.
  • I am jleclanche (https://keybase.io/jleclanche) on keybase.
  • I have a public key whose fingerprint is 1697 04C6 FB49 0C68 92C7 F23C 37E0 AF1F DA48 F373

To claim this, I am signing this object:

@jleclanche
jleclanche / github.py
Created March 2, 2015 07:56
Github mirror handler for LXQt
import hmac
import hashlib
import json
import logging
import os
import subprocess
import sys
from http.server import BaseHTTPRequestHandler, HTTPServer
try:
#!/usr/bin/env python
import re
import sys
REGEX = re.compile(r"^RewriteRule ([^ ]+) (.+?) \[([^\]]+)]")
def process_line(line):
if not line:
return
@jleclanche
jleclanche / boosters.py
Last active August 29, 2015 14:28
Hearthstone card booster processor
#!/usr/bin/env python
import csv
import datetime
import re
import sys
import fireplace.cards
from io import StringIO
from fireplace.enums import CardSet, CardType, Rarity
@jleclanche
jleclanche / gist:bc19d470e132bbb4f7c9
Created August 30, 2015 19:53
Immortal Argent Squire (id=7) bug
This file has been truncated, but you can view the full file.
[Power] GameState.DebugPrintPower() - GameEntity EntityID=1
[Power] GameState.DebugPrintPower() - tag=10 value=85
[Power] GameState.DebugPrintPower() - tag=TURN value=1
[Power] GameState.DebugPrintPower() - tag=ZONE value=PLAY
[Power] GameState.DebugPrintPower() - tag=ENTITY_ID value=1
[Power] GameState.DebugPrintPower() - tag=NEXT_STEP value=BEGIN_MULLIGAN
[Power] GameState.DebugPrintPower() - tag=CARDTYPE value=GAME
[Power] GameState.DebugPrintPower() - tag=STATE value=RUNNING
[Power] GameState.DebugPrintPower() - Player EntityID=2 PlayerID=1 GameAccountId=[hi=144115198130930503 lo=19524079]
[Power] GameState.DebugPrintPower() - tag=TIMEOUT value=75