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
// ==UserScript== | |
// @name anti key-grabber | |
// @description Prevent web apps from capturing and muting vital keyboard shortcuts | |
// @grant none | |
// @version 1.1 | |
// ==/UserScript== | |
(function(){ | |
var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x"); | |
unsafeWindow.document.addEventListener('keydown', function(e) { | |
if (e.keyCode === 116) { |
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
root@edison:~# lsusb -v | |
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub | |
Device Descriptor: | |
bLength 18 | |
bDescriptorType 1 | |
bcdUSB 2.00 | |
bDeviceClass 9 Hub | |
bDeviceSubClass 0 Unused | |
bDeviceProtocol 2 TT per port |
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
{ | |
if ( $2 != old_nr ) { | |
print output_candidate | |
output_candidate = $0 | |
candidate_result = $3 | |
} else { | |
if ( candidate_result != "pass" ) { | |
output_candidate = $0 | |
candidate_result = $3 | |
} |
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
#!/bin/bash | |
set -ue | |
RUBY_SRC='ruby-1.9.3-p551' | |
TARGET_PREFIX='/data/local/tmp/local' | |
export NDK_TOP="/opt/android-ndk-r10d" | |
export SYSROOT="$NDK_TOP/platforms/android-21/arch-arm64" | |
#export CFLAGS="-Ofast" | |
export CC="$NDK_TOP/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-gcc -mandroid --sysroot=$SYSROOT" |
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
/* | |
* For more examples see http://www.mozilla.org/unix/customizing.html | |
*/ | |
#nav-bar, | |
#nav-bar > *, | |
#nav-bar > * > *, | |
{ | |
margin: 0 !important; | |
padding: 0 !important; | |
} |
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
#!/bin/bash | |
## You need 'flock' from util-linux. | |
set -eu | |
SYNERGY_CLIENT='/Applications/Synergy.app/Contents/MacOS/synergyc' | |
SYNERGY_LOG=${HOME}/.synergy-tunnel.log | |
SYNERGY_SERVER='ryoichi-ubuntu.aka" | |
SSH_TUNNEL_OPT="localhost:24800:$SYNERGY_SERVER:24800" |
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
#!/bin/bash | |
set -eu | |
convert_to_mp4 () { | |
input="$1" | |
output="${input%.*}.mp4" | |
ffmpeg -i "$input" -c:v libx264 -crf 23 -profile:v high -r 30 -c:a libfaac -q:a 100 -ar 48000 "$output" | |
} | |
errors=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
#!/usr/bin/python | |
import sys | |
NR_LAYER = 10 | |
def get_n_plus_1(weights): | |
length = len(weights) | |
lower_weights = [[1 for col in range(length+1)] for row in range(length+1)] | |
print "---- %d -----" % len(weights) |
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
#!/bin/bash | |
# | |
# http://iharder.sourceforge.net/current/macosx/imagesnap/ | |
# | |
normal_interval_sec=30 | |
cloud_interval=4 | |
save="$HOME/usr/var/SurCam" | |
save_cloud="$HOME/Dropbox/SurCam" |
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
-- | |
-- split bstr into 3 parts: before, on, and after first line with match | |
-- | |
fgrep_line pat bstr = | |
if BS.null bstr | |
then (BS.empty, BS.empty, BS.empty) | |
else (head, BS.concat[left, right], rem) | |
where | |
(h, t) = breakOn pat bstr | |
left = BS.tail $ afterLast (pack "\n") h |