This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <linux/limits.h> | |
#define ERROR_PRINTF(fmt, args...) {\ | |
fprintf(stderr, fmt, args); \ |
This file contains hidden or 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 <stdlib.h> | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#include <errno.h> | |
#include <string.h> | |
#define ERROR_PRINTF(fmt, args...) { \ | |
fprintf(stderr, fmt, args); \ |
This file contains hidden or 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 'httparty' # `gem install httparty` | |
require 'cgi' | |
require 'digest/md5' | |
require 'nokogiri' # `gem install nokogiri` | |
require 'pathname' | |
require 'set' | |
ROOT = Pathname File.expand_path(__dir__) | |
DOWNLOAD_PATH = ROOT.join 'Downloads' |
This file contains hidden or 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
sshtunnel() { | |
OPTIND=1 | |
PROGRAM=$0 | |
# Common default parameters | |
PROXY_USER=`whoami` | |
PROXY_SSH_PORT=22 | |
MONITOR_PORT=18524 | |
PROXY_PORT=8080 |
This file contains hidden or 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 | |
cd `mktemp -dt tmp` | |
git clone http://git.kernel.org/pub/scm/docs/man-pages/man-pages | |
cd man-pages | |
for f in man?/**/*.?; do mv -v $f `dirname $f`/linux.`basename $f`; done | |
sudo make install | |
cd .. | |
rm -rf man-pages |
This file contains hidden or 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 'digest/md5' | |
Dir['**/*']. | |
select {|f| File.file? f }. | |
group_by {|f| Digest::MD5.hexdigest(File.binread(f)).tap {|md5| STDERR.puts "#{f}: #{md5}" } }. | |
reject {|_, list| list.size == 1 }. | |
each {|_, v| puts "---\n#{v.join("\n")}" } |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
) | |
type Handler func(int) | |
func test(handler Handler) { | |
handler(1) |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func main() { | |
fmt.Printf("%d\n", int8(math.Pow(2, 10))) // => 0 | |
} |
This file contains hidden or 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/ruby | |
require "socket" | |
require "openssl" | |
require "thread" | |
listeningPort = Integer(ARGV[0]) | |
server = TCPServer.new(listeningPort) | |
sslContext = OpenSSL::SSL::SSLContext.new |
This file contains hidden or 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> | |
<body> | |
<div id="editor" style="height: 500px; width: 800px">Type in a word like "will" below and press ctrl+space or alt+space to get "rhyme completion"</div> | |
<div id="commandline" style="position: absolute; bottom: 10px; height: 20px; width: 800px;"></div> | |
</body> | |
<script src="https://rawgithub.com/ajaxorg/ace-builds/master/src/ace.js" type="text/javascript" charset="utf-8"></script> | |
<script src="https://rawgithub.com/ajaxorg/ace-builds/master/src/ext-language_tools.js" type="text/javascript" charset="utf-8"></script> | |
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script> | |
<script> | |
var langTools = ace.require("ace/ext/language_tools"); |