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
# | |
# SCHTASKS /Create /F /TN wallpaper-from-reddit /TR "C:\usr\bin\ep.bat" /SC HOURLY | |
# ep.bat : | |
# rubyw C:\usr\bin\earthporn-to-wallpaper.rb | |
path="c:/usr/www/images/ep" | |
fr=path+"/fpersist.rb" | |
if ARGV.first == "delete" | |
puts "Delete all jpeg file in '#{path}' directories ..." | |
Dir.glob(path+"/*.jpg").each {|fn| File.delete(fn) } |
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 'json' | |
mess=File.read(ARGV.first).split(/\r?\n/).join("").gsub(/\s\s+/," ") | |
loop { | |
JSON.parse(mess) rescue break | |
exit(0) | |
} | |
loop { |
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 | |
################################################################################# | |
# autopatch.rb : Create a autoinstallable script | |
# | |
# use 'tar czf' and base64 for serialize a directory in ascii data, embedded it in a ruby script. | |
# Executing this script will untar the data in current directory | |
# | |
#-------------------------------------------------------------------------------- | |
# Create autoinstaller : | |
# > ruby autopatch.rb /opt/foo |
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
* { | |
font-size: small; | |
} | |
div#cols { | |
column-width: 20em; | |
column-gap: 4px; | |
column-rule-style: solid; | |
column-rule-color: #044; | |
} | |
h2,h3,h4,h5 { |
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
str=<<'EEOF' | |
"a,b,c,d".split(/,/) | |
"a,bb,c".scan(/\w+/) | |
[1,2,3].inspect | |
[1,2,3].join(",") | |
Hash[1,2,3,4] | |
h=[1,2,3,4,5,6,7,8].group_by {|v| v%4} | |
h.to_a() | |
h.keys() | |
h.values() |
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 'ssl_certificate' | |
require 'open-uri' | |
require 'json' | |
require 'nokogiri' | |
#require "win32/sapi5" | |
#include Win32 | |
#$audio = SpVoice.new | |
#$audio.Rate=1 | |
#$audio.Volume=100 |
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
div#app |
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 "router" | |
require "io/memory" | |
############################################################################ | |
# Tools | |
############################################################################ | |
def to_table(ll) | |
ll.map {|l| | |
"<tr><td>#{l.join("</td><td>")}</td></tr>" |
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 "../src/kemal.cr" | |
require "io/memory" | |
############################################################################ | |
# Tools | |
############################################################################ | |
def to_table(ll) | |
ll.map {|l| | |
"<tr><td>#{l.join("</td><td>")}</td></tr>" |
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
/////////////////////////////////////////////////////////////////////////// | |
/// SMSPROXY | |
// client sms ===> smsproxy ==> http://xxxx.org?from=number&msg= | |
// <--- response | |
// <=====reply | |
// | |
/////////////////////////////////////////////////////////////////////////// | |
function OnStart() | |
{ |
NewerOlder