parent
47a4a952f1
commit
fc9ef8fafc
@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
fan_speed = (ARGV.shift || 1100).to_i
|
||||
|
||||
smc = '~/Applications/smcFanControl.app/Contents/Resources/smc'
|
||||
fan_speed = (fan_speed << 2).to_s(16)
|
||||
`#{smc} -k F1Mx -w #{fan_speed}`
|
@ -1,21 +0,0 @@
|
||||
require 'fileutils'
|
||||
include FileUtils
|
||||
|
||||
conflicts = `find ~/Dropbox -name "*conflicted*"`.split("\n")
|
||||
diffs = conflicts.each.with_object({}) { |conflict, diffs|
|
||||
actual = conflict.sub(/ \(.*'s conflicted copy \d{4}-\d{2}-\d{2}\)/, '')
|
||||
diffs[conflict] = `diff "#{actual}" "#{conflict}"`
|
||||
}
|
||||
|
||||
same, diff = diffs.partition {|_,diff| diff.empty? }
|
||||
|
||||
same.each do |conflict, _|
|
||||
rm conflict
|
||||
end
|
||||
|
||||
puts diff.map { |conflict, diff|
|
||||
[conflict, diff].join("\n")
|
||||
}.join("\n")
|
||||
|
||||
# require 'pry'
|
||||
# binding.pry
|
@ -1,9 +0,0 @@
|
||||
require "open-uri"
|
||||
require "rexml/document"
|
||||
|
||||
html = open('https://en.wikipedia.org/wiki/List_of_spacecraft_in_the_Culture_series').read
|
||||
doc = REXML::Document.new(html)
|
||||
tds = doc.elements.to_a('//table[tr/th/text()="Name"]/tr//td[3]')
|
||||
names = tds.map {|td| REXML::XPath.match(td, './/text()')[0] }
|
||||
|
||||
puts names
|
Loading…
Reference in new issue