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
| <% sitemap.resources.select {|r| r.path =~ /\.html\z/i }.each do |resource| %> | |
| <%= resource.destination_path %> | |
| <% end %> |
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
| --- array.c~ Thu Dec 21 14:39:19 1995 | |
| +++ array.c Thu Dec 21 14:36:06 1995 | |
| @@ -283,8 +283,8 @@ | |
| end = len + end; | |
| if (end < 0) end = 0; | |
| } | |
| - if (len < end) end = len; | |
| - if (beg < end) { | |
| + if (end > len) end = len; | |
| + if (beg > end) { |
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 | |
| require "digest" | |
| require "find" | |
| require "optparse" | |
| options = {} | |
| OptionParser.new do |opts| | |
| opts.banner = "Usage: recursive-hashes [options]" |
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
| <!DOCTYPE html> | |
| <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport"> <title>Offline for maintenance</title> <style>html, body { | |
| font-family: sans-serif; | |
| -ms-text-size-adjust: 100%; | |
| -webkit-text-size-adjust: 100%; | |
| background-color: #F7F8FB; | |
| height: 100%; | |
| -webkit-font-smoothing: antialiased; } | |
| body { |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
| 20;91;Prologue;ID=9600;TEMP=0104; | |
| 20;A0;Oregon TempHygro;ID=CC1D;TEMP=00fb;HUM=45;HSTATUS=0;BAT=OK; | |
| 20;A1;Prologue;ID=9600;TEMP=0104; | |
| 20;A2;Alecto V1;ID=0168;TEMP=0080;HUM=32;BAT=OK; |
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
| # Convert signed hexadecimals from RFLink to floats | |
| def signed_to_float(hex) | |
| int = hex.to_i(16) | |
| if int & 0x8000 > 0 | |
| -(int & 0x7FFF).to_f / 10 | |
| else | |
| int.to_f / 10 | |
| end | |
| end |
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
| # Set the Scheduler frequency to Hourly | |
| if [[ $(TZ=Europe/Helsinki date +%H) = 07 ]] ; then echo "Do the thing!" ; else echo "Not 7am" ; fi |
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
| begin | |
| require "dnsruby" | |
| rescue LoadError | |
| puts "gem install dnsruby" | |
| end | |
| require "yaml/store" | |
| include Dnsruby | |
| trap("SIGINT") { exit 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
| :8080 { | |
| # Redirect only when the requested host *isn't* an IP address | |
| redir 301 { | |
| if {hostonly} not_match ^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$ | |
| if {hostonly} not_match ^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$ | |
| if_op and | |
| http://www.{hostonly}{uri} | |
| } | |
| } |
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 "fileutils" | |
| require "json" | |
| json = File.open("Contents.json", "r+") | |
| contents = JSON.load(json.read) | |
| contents["images"].map do |image| | |
| ext = File.extname(image["filename"]) | |
| new_filename = "#{image["size"]}@#{image["scale"]}#{ext}" | |
| FileUtils.mv(image["filename"], new_filename) |