This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cinttypes> | |
#include <stdexcept> | |
#include <set> | |
union IPv4Addr { | |
struct { | |
uint32_t x; | |
uint8_t prefix; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems/remote_fetcher' | |
require 'rubygems/user_interaction' | |
require 'rubygems/errors' | |
require 'rubygems/text' | |
## | |
# SpecFetcher handles metadata updates from remote gem repositories. | |
class Gem::SpecFetcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fatal() { | |
echo "$@" | |
exit 1 | |
} | |
get_vendor_dir() { | |
[ -n "$VENDOR" ] && echo $VENDOR && return | |
[ -d src ] && echo src/vendor && return | |
echo vendor | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'term/ansicolor' | |
require 'logger' | |
class String | |
include Term::ANSIColor | |
end | |
class ColorfulLogger < Logger | |
def initialize(logdev, shift_age = 0, shift_size = 1048576) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem Enable Win+L, Lock Windows, Disable Win+L. | |
rem Useful as a workaround to disable Win+L while being able to lock. | |
rem This makes sence if you are using Win+L for other purpose, for example, use Win+L inside a virtual Linux system. | |
rem Run this as Administrator. If it is annoying, try UAC Trust shortcut from www.itknowledge24.com | |
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableLockWorkstation /t REG_DWORD /d 0 /f | |
rundll32 user32.dll,LockWorkStation | |
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableLockWorkstation /t REG_DWORD /d 1 /f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# quick & dirty preforked echo server listening on /tmp/server | |
# client: socat unix-connect:/tmp/server stdout | |
import os, sys, time, socketserver | |
class PreforkMixIn: | |
max_nchildren = 3 | |
children = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
gem 'i3ipc', '~> 0.2.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Highlight Shadow | |
// Aluminium #eeeeec #d3d7cf #babdb6 | |
// Butter #fce94f #edd400 #c4a000 | |
// Chameleon #8ae234 #73d216 #4e9a06 | |
// Orange #fcaf3e #f57900 #ce5c00 | |
// Chocolate #e9b96e #c17d11 #8f5902 | |
// Sky Blue #729fcf #3465a4 #204a87 | |
// Plum #ad7fa8 #75507b #5c3566 | |
// Slate #888a85 #555753 #2e3436 | |
// Scarlet Red #ef2929 #cc0000 #a40000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'digest' | |
hosts = ARGV.to_a | |
hosts = $<.each_line.map(&:chomp) if hosts.empty? | |
hosts.uniq! | |
def system! *args | |
raise "Cannot exec #{args}" unless system(*args.flatten) |