Skip to content

Instantly share code, notes, and snippets.

View crahan's full-sized avatar

Thomas Bouve crahan

View GitHub Profile
@Ardillo
Ardillo / js
Created December 17, 2019 22:37
window.setInterval(thanosify, 2000);
function thanosify(){
[].forEach.call(document.querySelectorAll('.player'), function (el) {
if (el.className.includes("me")) {
console.log(el)
} else {
el.style.visibility = 'hidden'
}
});}
@mak
mak / wcr.py
Last active October 28, 2018 21:09
Extract everything from WannaCry
import re
import os,sys
import pefile
import struct
import zipfile
import hashlib
import StringIO
from Crypto import Random
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5,AES
@ttscoff
ttscoff / tm.completion.bash
Last active November 17, 2016 22:17
Fuzzy Bash completion for tmux session/window using [tm](http://brettterpstra.com/2014/05/11/making-my-tmux-life-easier/)
_tm_complete() {
local rx
local token=${COMP_WORDS[$COMP_CWORD]}
local IFS=$'\t'
local words
if [ $COMP_CWORD -eq 2 ]; then
words=$(tmux list-windows -t ${COMP_WORDS[1]} 2> /dev/null | awk '{print $2}' | tr -d '*-' | tr "\n" "\t")
elif [ $COMP_CWORD -eq 1 ]; then
words=$(tmux -q list-sessions 2> /dev/null | cut -f 1 -d ':' | tr "\n" " ")
fi
#!/bin/bash
# Bash completion for `up` <http://brettterpstra.com/2014/05/14/up-fuzzy-navigation-up-a-directory-tree/>
_up_complete()
{
local rx
local token=${COMP_WORDS[$COMP_CWORD]}
local IFS=$'\t'
local words=$(dirname `pwd` | tr / " ")
local nocasematchWasOff=0
@ttscoff
ttscoff / up.sh
Last active June 20, 2016 10:07
up: Quickly cd up a directory tree
# inspired by `bd`: https://github.com/vigneshwaranr/bd
function _up() {
local rx updir
rx=$(ruby -e "print '$1'.gsub(/\s+/,'').split('').join('.*?')")
updir=`echo $PWD | ruby -e "print STDIN.read.sub(/(.*\/${rx}[^\/]*\/).*/i,'\1')"`
echo -n "$updir"
}
function up() {
if [ $# -eq 0 ]; then
@ttscoff
ttscoff / tm.bash
Last active April 11, 2023 23:55
A shell function to wrap tmux and make the basic commands a bit easier
#!/bin/bash
__lower() {
echo "$@"|tr "[:upper:]" "[:lower:]"
}
__menu() {
local result=""
PS3=$1
shift
@ttscoff
ttscoff / total_numbers.rb
Created April 7, 2014 19:42
Sum all numbers found in the input
#!/usr/bin/ruby
decimal = "."
separator = ","
if RUBY_VERSION.to_f > 1.9
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
input = STDIN.read.force_encoding('utf-8')
else
@pjaspers
pjaspers / gist:9131345
Last active April 28, 2022 07:52
ICQ list.
000787466 @bramus
006904094 @inferis
008093150 @tomklaasen
010686174 @to1ne
011006380 @tijs
023055424 @crahan
063846821 @junkiesxl
075540649 @maxvoltar
084511154 @atog
102812969 @nilo
@ttscoff
ttscoff / getpinboard.rb
Created December 27, 2013 23:37
Pinboard to Mavericks tags
#!/usr/bin/ruby
##############################################################################
### getpinboard.rb by Brett Terpstra, 2011 <http://brettterpstra.com>
### Retrieves Pinboard.in bookmarks, saves as local .webloc files for
### Spotlight searching.
###
### Optionally adds OpenMeta tags and/or saves page as PDF (see config below)
### Use -r [NUMBER OF DAYS] to reset the "last_checked" timestamp (primarily
### for debugging).
###
@Zettt
Zettt / OpenMeta2OSXTags.sh
Last active May 5, 2021 15:58
Script that reads OpenMeta tags and writes them to OS X Mavericks tags. http://mosx.tumblr.com/post/54049528297/convert-openmeta-to-os-x-mavericks-tags-with-this This requires a OpenMeta binary to be installed. Change its path, if you prefer it to be somewhere else. For the files to be processed properly don't include a trailing slash in `$files…
# =============================================================
# = OpenMeta to OS X Tags =
# =============================================================
# Script to convert OpenMeta tags to OS X Mavericks tags.
#
# Created by Zettt (Andreas Zeitler) on 2013-06-28
# Source www.macosxscreencasts.com, mosx.tumblr.com
#
# OpenMeta to OS X Tags by Andreas Zeitler is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike