This file contains 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 collatz(i) | |
puts i | |
return if i==1 | |
i.odd? ? collatz(3*i+1) : collatz(i/2) | |
end |
This file contains 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
find . -type f -name "*.log" -exec dd if=/dev/null of={} \; |
This file contains 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
.container{ | |
margin-top:20px; | |
} | |
.image-preview-input { | |
position: relative; | |
overflow: hidden; | |
margin: 0px; | |
color: #333; | |
background-color: #fff; | |
border-color: #ccc; |
This file contains 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
# attributes.yml: | |
nl: &attributes | |
article: | |
title: Titel | |
short_title: Meta titel | |
# active_record.yml: | |
nl: |
This file contains 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
kanso push http://localhost:5984/example | |
Reading dependency tree... | |
loading . | |
preprocessor attachments/add | |
loading packages/attachments | |
postprocessor attachments/cleanup | |
Build complete: 21ms | |
Error: Error: connect ECONNREFUSED | |
at errnoException (net.js:769:11) | |
at Object.afterConnect [as oncomplete] (net.js:760:19) |
This file contains 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
git config --global push.default current | |
git config --global pull.default current |
This file contains 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 'ya2yaml' | |
rescue LoadError | |
print "The locales tasks were not loaded, since ya2yaml gem is not present. Don't worry if this is a production machine, it is required for development only.\n" | |
else | |
LOCALES_PATHS = ["#{Rails.root}/config/locales/", "#{Rails.root}/config/locales/activerecord/", "#{Rails.root}/config/locales/authlogic/", "#{Rails.root}/config/locales/notification_templates/"] | |
MASTER_LOCALE = "en" | |
IGNORE_FILES = %w(en.yml en-UK.yml) |
This file contains 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
/** Replaces video tag (src=[file].mp4) with flash for Firefox, Opera and IE <9 | |
Make sure you have flowplayer! (www.flowplayer.org) | |
width, height and src of the video should be set | |
*/ | |
function replaceVideoWithFlash() { | |
if(navigator.userAgent.indexOf('Firefox') != -1 || navigator.userAgent.indexOf('Opera') != -1 || ( navigator.userAgent.indexOf('MSIE') != -1 && parseFloat(navigator.appVersion.split("MSIE")[1]) < 9 )) { | |
var videos = document.getElementsByTagName('video'); | |
for(var i=0; i < videos.length ; i++) { | |
var video = videos[i]; | |
var src = video['src']; |
This file contains 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
class Integer | |
def to_leading_zero_string | |
(self < 10) ? "0#{self}" : self | |
end | |
end | |
#To get all episodes of kabouter Wesley, where 21 is the amount of episodes | |
21.times do |i| | |
system "wget http://kabouterwesley.pro-networks.nl/afleveringen/aflevering_#{(i+1).to_leading_zero_string}.mp4" | |
end |