Skip to content

Instantly share code, notes, and snippets.

View ThiefMaster's full-sized avatar
🐈
Scratching your code.

Adrian ThiefMaster

🐈
Scratching your code.
  • CERN / @indico
  • Geneva, Switzerland
View GitHub Profile
from ctypes import windll, byref, Structure, WinError, POINTER, WINFUNCTYPE
from ctypes.wintypes import BOOL, HMONITOR, HDC, RECT, LPARAM, DWORD, BYTE, WCHAR, HANDLE
import sys
_MONITORENUMPROC = WINFUNCTYPE(BOOL, HMONITOR, HDC, POINTER(RECT), LPARAM)
class _PHYSICAL_MONITOR(Structure):
_fields_ = [('handle', HANDLE),
function urlFromHash() {
if (location.hash.substr(0, 2) != '#!') {
return null;
}
// why not location.hash? => http://stackoverflow.com/q/4835784/298479
return location.href.split('#')[1].substr(1);
}
$('#gallery').magnificPopup({
type: 'image',
Hello,
My name is Nathan Bernard, I am the founder of iFiltr, an open source
social shopping website (https://github.com/ifiltr/ifiltr). I came
across your profile on GitHub and we are seeking contributors interested
in helping us model our own database for products. More details are
explained in this very detailed task, located in our repository’s issue
tracker (https://github.com/ifiltr/ifiltr/issues/1) — the task touches
on many different aspects needing to be completed and it can be broken
down into multiple tasks, but to make things easier:
insmod all_video
insmod png
insmod gfxmenu
insmod font
loadfont $prefix/themes/starfield/dejavu_10.pf2
loadfont $prefix/themes/starfield/dejavu_12.pf2
loadfont $prefix/themes/starfield/dejavu_14.pf2
loadfont $prefix/themes/starfield/dejavu_16.pf2
loadfont $prefix/themes/starfield/dejavu_bold_14.pf2
@ThiefMaster
ThiefMaster / darkblue_256.vim
Created December 22, 2013 16:46
darkblue.vim, modified to look good fine on xterm-256color
" Vim color file
" Maintainer: Bohdan Vlasyuk <bohdan@vstu.edu.ua>
" Last Change: 2006 Apr 30
" darkblue -- for those who prefer dark background
" [note: looks bit uglier with come terminal palettes,
" but is fine on default linux console palette.]
set bg=dark
hi clear
@ThiefMaster
ThiefMaster / promptrc.sh
Created December 23, 2013 00:55
a nice bash prompt
# vim: ft=sh
function set_prompt {
local BLACK="\[\033[0;30m\]"
local BLUE="\[\033[0;34m\]"
local GREEN="\[\033[0;32m\]"
local CYAN="\[\033[0;36m\]"
local RED="\[\033[0;31m\]"
local PURPLE="\[\033[0;35m\]"
local BROWN="\[\033[0;33m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
@ThiefMaster
ThiefMaster / tmux.conf
Last active November 23, 2020 05:34
my tmux config
set -g prefix C-a
bind C-s send-prefix
bind F11 set -g prefix C-a \; display-message 'Prefix: ^A'
bind F12 set -g prefix C-b \; display-message 'Prefix: ^B'
unbind Space
bind h clear-history \; display-message 'Cleared history'
bind C new-window -c ~
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
@ThiefMaster
ThiefMaster / .gitconfig
Last active September 18, 2018 12:13
my git config
[alias]
lg = log --color=always --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lga = log --color=always --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --abbrev-commit --date=iso
purr = pull --rebase
puff = pull --ff-only
mff = merge --ff-only
fall = fetch --all
pigamend = "!f(){ git add -u && git commit --amend --no-edit; }; f"
[color]
ui = auto
#!/bin/bash
n=0
lines=
newline='
'
LINES=$(tput lines)
case $LINES in
''|*[!0-9]*) exec less;;
__auto_venv() {
local venv="$HOME/.python-env"
local current="$VIRTUAL_ENV"
local ps1
# check if we are REALLY inside a venv and not just inherited $VIRTUAL_ENV
if ! type -t deactivate > /dev/null; then
current=""
fi