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
gradient_percentage = 0.10 | |
# Split into RGB | |
red = backgroundcolor[0,2].hex | |
green = backgroundcolor[2,2].hex | |
blue = backgroundcolor[4,2].hex | |
# Add percentage (could subtract if you want to darker) | |
red += (red * gradient_percentage).to_i | |
green += (green * gradient_percentage).to_i |
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 'nokogiri' | |
require 'open-uri' | |
require 'httparty' | |
require 'pathname' | |
class CategoryItem | |
attr_accessor :title, :description, :feed, :element | |
def initialize(node) | |
@element = node |
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
d-i partman-auto-lvm/guided_size string max | |
d-i partman-auto/expert_recipe string \ | |
boot-root :: \ | |
500 50 500 ext4 \ | |
$primary{ } $bootable{ } \ | |
method{ format } format{ } \ | |
use_filesystem{ } filesystem{ ext4 } \ | |
mountpoint{ /boot } \ | |
. \ |
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
def duration_as_hhmm | |
seconds = adjusted_duration | |
hours = (seconds / 3600).to_i | |
minutes = (seconds - (hours * 3600)) / 60 | |
# hhmm | |
"#{'%02d' % hours}#{'%02d' % minutes % 60}" | |
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
if Gem::VERSION >= "1.3.6" | |
module Rails | |
class GemDependency | |
def requirement | |
r = super | |
(r == Gem::Requirement.default) ? nil : r | |
end | |
end | |
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
template = File.read('/path/to/template') | |
builder = Nokogiri::XML::Builder.new do |xml| | |
eval File.read(template) | |
end | |
builder.to_xml |
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
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
<meta http-equiv="Pragma" content="no-cache"> | |
<SCRIPT language="javascript"> | |
window.self.focus() | |
</SCRIPT> | |
<title>RSS_Weather02_newcrawl</title> |
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
ffmpeg -i <inputFile> -f mpegts -acodec libfaac -vcodec libx264 \ -vpre roku -crf 15 -threads 0 ~/OneTransportStreamFile3200.ts |
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 'yaml' | |
config = YAML.load_file(File.expand_path(File.join(SINATRA_ROOT, 'config', 'mongo.yaml'))) | |
db = config[ENV['RACK_ENV'].downcase] | |
uri = "mongodb://#{db['username']}:#{db['password']}@#{db['host']}:#{db['port']}/#{db['database']}" | |
DB = Mongo::Connection.from_uri(uri).db(db['database']) |
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
WARN server comment 2011-05-26 09:29:14 - - - 31.366 - - - - - - - - LiveStreamPacketizerSmoothStreaming.handlePacket[lomalinda/_definst_/3-1]: Fragment duration greater than suggested range of 1-4 seconds. Adjust keyframe interval accordingly: Fragment durations: [4.9,4.9,4.9] | |
WARN server comment 2011-05-26 09:29:14 - - - 31.367 - - - - - - - - LiveStreamPacketizerSmoothStreaming.handlePacket[lomalinda/_definst_/3-2]: Fragment duration greater than suggested range of 1-4 seconds. Adjust keyframe interval accordingly: Fragment durations: [4.9,4.9,4.9] | |
WARN server comment 2011-05-26 09:29:14 - - - 31.367 - - - - - - - - LiveStreamPacketizerSmoothStreaming.handlePacket[lomalinda/_definst_/3-3]: Fragment duration greater than suggested range of 1-4 seconds. Adjust key |