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
td.message { | |
background-color: #000000; | |
color: #dedede; | |
} | |
td.date { | |
background-color: #000000; | |
} | |
tr.dateChange td { |
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
import Data.Char | |
strToInt :: String -> Int | |
strToInt [] = 0 | |
strToInt (x:xs) | |
| x == '-' = - strToInt xs | |
| otherwise = foldl step 0 (x:xs) | |
where step acc x = acc * 10 + (digitToInt x) | |
strToDouble :: String -> Double |
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/sh | |
iwconfig wlan0 2>&1 | grep -q no\ wireless\ extensions\. && { | |
echo wired | |
exit 0 | |
} | |
essid=`iwconfig wlan0 | awk -F '"' '/ESSID/ {print $2}'` | |
stngth=`iwconfig wlan0 | awk -F '=' '/Quality/ {print $2}' | cut -d '/' -f 1` | |
bars=`expr $stngth / 10` |
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
q = 39 | |
l = [ | |
'q = 39', | |
'l = [', | |
' ', | |
']', | |
'', | |
'l.each_with_index do |line, index|', | |
' if index == 2', | |
' l.map{|line_| " " + q.chr + "#{line_}" + q.chr}.join(",\n").split("\n").each{|line_| puts line_}', |
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/env ruby | |
# coding: utf-8 | |
require 'rb-inotify' | |
CLEAR = "\n----\n" | |
YELLOW, BLUE, GREY, HIGHLIGHT = '0;33', '0;34', '0;90', '1;30;47' | |
SHORTEST_MESSAGE = 12 | |
LOG_CMD = %{git log --all --date-order --graph --color --pretty="format: \2%h\3\2%d\3\2 %an, %ar\3\2 %s\3"} | |
LOG_REGEX = /(.*)\u0002(.*)\u0003\u0002(.*)\u0003\u0002(.*)\u0003\u0002(.*)\u0003/ |
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 'rubygems' | |
require 'bundler/setup' | |
require 'wavefile' | |
require 'json' | |
include WaveFile | |
format = Format.new(:mono, 16, 1000) | |
writer = Writer.new("sound.wav", format) |
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/env ruby | |
def format_commit_info timestamp, time_desc, commit_id, message, ref_name | |
[ | |
"#{timestamp.strftime("%y %b %d")}, #{timestamp.strftime("%l:%M%p").downcase}", | |
"(#{time_desc})", | |
commit_id, | |
message, | |
ref_name | |
] |
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 racket/trace) | |
> (load "quicksort.rkt") | |
> (trace qsort) | |
> (qsort '(5 4 3 2 1)) | |
>(qsort '(5 4 3 2 1)) | |
> (qsort '(4 3 2 1)) | |
> >(qsort '(3 2 1)) | |
> > (qsort '(2 1)) | |
> > >(qsort '(1)) | |
> > > (qsort '()) |
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
(define (qsort a) | |
(if (empty? a) | |
a | |
(let ([p (car a)]) | |
(let ([tail (cdr a)]) | |
(let ([lsr (filter (lambda (x) (< x p)) tail)]) | |
(let ([grt (filter (lambda (x) (>= x p)) tail)]) | |
(append (qsort lsr) (list p) (qsort grt)))))))) |
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 'net/http' | |
require 'uri' | |
GC.disable | |
threads = 100.times.map do | |
Thread.new do | |
10.times do | |
uri = URI.parse('http://example.com') | |
http = Net::HTTP.new(uri.host, uri.port) | |
request = Net::HTTP::Get.new(uri.request_uri) |
OlderNewer