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
javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg>f.fn.jquery%7C%7Ch(f))%7Bc=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd=="loaded"%7C%7Cd=="complete"))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,"1.3.2",function($,L)%7B$('%23header, .pagehead, .breadcrumb, .commit, .meta, %23footer, %23footer-push, .wiki-actions, %23last-edit, .actions, .header,.site-footer,.repository-sidebar,.file-navigation,.gh-header-meta,.gh-header-actions,#wiki-rightbar,#wiki-footer,.commit-tease').remove();%20$('%23files,%20.file').css(%7B%22background%22:%22none%22,%20%22border%22:%22none%22%7D);%20$('link').removeAttr('media');%7D); var removeMe = document.getElementsByClassName("file-header")[0]; removeMe.parentNode.removeChild(removeMe); |
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
find -P . -type f | rev | cut -d/ -f2- | rev | cut -d/ -f1-2 | cut -d/ -f2- | sort | uniq -c |
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
values = 20.times.map{rand(100)+200} | |
delta = 10 | |
min, max = values.minmax | |
offset = min - delta / 2 | |
grouped = values.group_by { |value| (value - offset) / delta } | |
Hash[grouped.sort] | |
=begin |
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
// | |
// main.m | |
// keyboard_layout_switcher | |
// | |
@import Carbon; | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
if (argc <= 1){ |
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
class Meter | |
attr_reader :value, :unit | |
def initialize(value, unit = 'm') | |
@value = value | |
@unit = unit | |
end | |
def self.[](value) | |
self.new(value) |
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 'matrix' | |
tolerance = Vector[5, 5, 5] | |
elements = [Vector[2, 1, 4], Vector[20, 100, 25], Vector[21, 98, 21], Vector[1, 2, 3]] | |
clusters = [] | |
while(elements.any?) | |
element = elements.pop | |
cluster, elements = elements.partition do |elem| | |
diff = tolerance - (elem - element).map(&:abs) |
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
sudo apt-get install build-essential pkg-config libc6-dev libssl-dev libexpat1-dev libavcodec-dev libgl1-mesa-dev libqt4-dev | |
wget http://www.makemkv.com/download/makemkv-oss-1.9.0.tar.gz | |
wget http://www.makemkv.com/download/makemkv-bin-1.9.0.tar.gz | |
tar -xvf makemkv-oss-1.9.0.tar.gz | |
tar -xvf makemkv-bin-1.9.0.tar.gz | |
cd makemkv-oss-1.9.0/ | |
./configure | |
make | |
sudo make install |
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
ffmpeg -i in.mts -c:v mpeg4 -qscale:v 5 -acodec libmp3lame -b:a 192k out.mp4 |
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 bash | |
size=1024 # MB | |
mount_point=$HOME/tmp | |
name=$(basename "$mount_point") | |
usage() { | |
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \ | |
"(default: mount)" >&2 | |
} |
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 | |
################################################### | |
## Display screen dimensions in macOS using ruby ## | |
################################################## | |
# found https://developer.apple.com/reference/coregraphics/1456395-cgdisplaybounds?language=objc | |
# --> use CoreGraphics framework | |
# --> CGRect CGDisplayBounds(CGDirectDisplayID display); | |
############################################# |