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 'digest/md5' | |
| def clean_directory(d) | |
| path = File.join('pix', d) | |
| to_delete = Array.new | |
| files = Array.new | |
| Dir.new(path).each do |f| | |
| if not File.directory? File.join('pix', d, f) | |
| file_path = File.join(path, f) |
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 | |
| .',,,. | |
| ...,,,,,. | |
| ..'',;;;:;'. | |
| .,,,;;,,,;:c,' | |
| ... .,;,;:;,,,,;:c;,. | |
| ;c:;,'.... ..,:lc:::::;,,,,,;c:'. | |
| .;'.'''...','. ..;coddo:ccc:::;,,,,;:c:'. | |
| .'',''...',,'''.. ..''... ...;coxxxxoc:llc:::;;;;;::cl;. | |
| .';;,'....',,;,,,,,.... ....';;;:oxxxxddol:,,:::c::coxkOOdlclollc::;;;;;;;;::'. |
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
| #pcm.!default { | |
| #type hw | |
| #card 1 | |
| #} | |
| ctl.!default { | |
| type hw | |
| card 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
| #!/bin/bash | |
| # Change those for valid ones | |
| HOMEDIR=/home/yourlogin | |
| RUBYVER="1.9.2-p318" | |
| # Adding to $PATH paths for rvm and ruby executables | |
| PATH=$PATH:$HOMEDIR/.rvm/bin:$HOMEDIR/.rvm/rubies/ruby-$RUBYVER/bin/ | |
| # Creating variable containing path to installed gems | |
| RUBYLIB=$HOMEDIR/.rvm/gems/ruby-$RUBYVER/gems/:$HOMEDIR/.rvm/gems/ruby-$RUBYVER@global/gems/ |
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
| Section "ServerLayout" | |
| Identifier "aticonfig Layout" | |
| Screen 0 "aticonfig-Screen[0]-0" 0 0 | |
| EndSection | |
| Section "Module" | |
| EndSection | |
| Section "Monitor" | |
| Identifier "aticonfig-Monitor[0]-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
| data = Array.new | |
| f = File.new('power_calculator.txt') | |
| f.each_line do |l| | |
| if l =~ /(\d*);(\d*);(\d*\.?\d*);(\d*\.?\d*)/ | |
| data << { | |
| time_from: $1.to_i, | |
| time_to: $2.to_i, | |
| energy: $3.to_f, | |
| utilization: $4.to_f, |
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
| url = "http://blitzortung.net/Images/image_b_pl.png" | |
| ref = "http://blitzortung.net" | |
| agent = "Internet Explorer 8.0" | |
| interval = 10*60 | |
| sleep_interval = 20 | |
| next_download_t = Time.now.to_i | |
| Dir.mkdir('data') unless File.exists?('data') | |
| loop do |
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
| module ApplicationHelper | |
| # Usage: | |
| # use in view with bootstrap | |
| # = simple_model_details(User.first) | |
| # | |
| # Keep in mind: | |
| # * it uses only locales in format like this 'en.user.email' | |
| # | |
| # Custom attributes: | |
| # = simple_model_details(User.first, attrs: ["email", "name"]) |
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
| function do_nothing() { | |
| return false; | |
| } | |
| // http://stackoverflow.com/questions/1681679/disabling-links-to-stop-double-clicks-in-jquery | |
| // prevent a second click for 10 seconds. :) | |
| $('.one_click').live('click', function(e) { | |
| $(e.target).attr("disabled", "disabled"); | |
| $(e.target).click(do_nothing); | |
| setTimeout(function(){ |
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" | |
| require "logger" | |
| class WebcamDownloader::Downloader | |
| def initialize | |
| @logger = Logger.new(STDOUT) | |
| @webcam_array = WebcamArray.new | |
| end |
OlderNewer