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 word,space in io.stdin:read("*l"):gmatch("(%S+)(%s*)") do | |
io.stdout:write( word:reverse()..space ) | |
end | |
io.stdout:write("\n") | |
--[[-- | |
-- $ echo 123 456-789 | lua word-rev.lua | |
-- 321 987-654 | |
--]]-- |
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
# https://en.wikipedia.org/wiki/ISO_8601 | |
date_to_iso8601() { | |
date ${1:+-d "$1"} -u +'%Y%m%dT%H%M%SZ' | |
} | |
iso8601_to_date() { | |
local yyyymmdd="${1%%T*}" | |
local hhmmss="${1#*T}" | |
hhmmss="${hhmmss%Z*}" |
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
local bytecode | |
do | |
local A="a" | |
local f1 = function() | |
return A | |
end | |
bytecode = string.dump(f1) | |
end | |
local env = {} | |
local f2 = load(bytecode, "", "b", env) |
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/sh | |
#set -x | |
#elapsed=12345600 | |
while true; do | |
s=$(( ${elapsed:-0} / 100 )) | |
d_=$(( $s / 86400 )) | |
s=$(( $s % 86400 )) | |
h_=$(( $s / 3600 )) |
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
local function t1(n) | |
local t = {} | |
for i = 1, n do | |
t[i] = "a" .. i | |
end | |
return table.concat(t, ',') | |
end | |
local function t2(n) | |
local a = n>0 and "a1" or "" |
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
code.google.com/p/address-sanitizer | |
code.google.com/p/andors-trail | |
code.google.com/p/android-scripting | |
code.google.com/p/ankidroid | |
code.google.com/p/chromium | |
code.google.com/p/corkami | |
code.google.com/p/crypto-js | |
code.google.com/p/csipsimple | |
code.google.com/p/dnscapy | |
code.google.com/p/dukto |
NewerOlder