|
|\_ app
|...
|\_ docker
| |
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
require 'pathname' | |
Pathname('./lib').children.select(&:directory?).map(&:basename).each do |name| | |
Dir["./lib/#{name}/**/*.rb"].each do |path| | |
begin | |
code = File.read(path) | |
code.gsub!(%r{^(\s*)require (['"])#{name}/([\w/]*)['"]}) do | |
relative_path = Pathname("./lib/#{name}/#{$3}.rb").relative_path_from(Pathname(path).dirname) | |
%Q{#{$1}require_relative #{$2}#{relative_path.to_s[0..-4]}#{$2}} | |
end | |
File.write(path, code) |
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
get_latest_release() { | |
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
grep '"tag_name":' | # Get tag line | |
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
} | |
# Usage | |
# $ get_latest_release "creationix/nvm" | |
# v0.31.4 |
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
# alias radio='function __radio(){ r=`grep -v "#" radios_nacionales.txt | grep -m 1 -i $1 | cut -d" " -f1`; cvlc $r 2> /dev/null; }; __radio' | |
# podria utilizarse mplayer en vez de vlc | |
AMs Nacionales | |
http://cdn.instream.audio:9288/stream Radio Madre 530 | |
https://streaming1.hostingmontevideo.com:7019/; Radio Colonia 550 | |
http://server.laradio.online:25224/live.mp3 Radio Argentina 570 | |
http://playerservices.streamtheworld.com/api/livestream-redirect/CONTINENTAL_SC Continental 590 | |
https://streammax.alsolnet.com/radiorivadavia Rivadavia 630 |
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
#!/bin/bash | |
__script_version="1.1" | |
#----------------------------------------------------------------------- | |
# Default values | |
#----------------------------------------------------------------------- | |
human_time="6:20 tomorrow" |
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time
class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime
steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
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
#!/usr/bin/env ruby --disable-gems | |
# Tab completion for minitest tests. | |
# | |
# INSTALLATION: | |
# | |
# 1. Put this file in a directory in your $PATH. Make sure it's executable | |
# 2. Run this: | |
# | |
# $ complete -o bashdefault -f -C /path/to/this/file.rb ruby |
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
/* Based on The MailChimp Reset INLINE: Yes. */ | |
/* Client-specific Styles */ | |
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */ | |
body{width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0;} | |
/* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/ | |
.ExternalClass {width:100%;} /* Force Hotmail to display emails at full width */ | |
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} | |
/* Forces Hotmail to display normal line spacing. More on that: http://www.emailonacid.com/forum/viewthread/43/ */ | |
#backgroundTable {margin:0; padding:0; width:100% !important; line-height: 100% !important;} | |
/* End reset */ |
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
namespace :deploy do | |
after :restart, :restart_passenger do | |
on roles(:web), in: :groups, limit: 3, wait: 10 do | |
within release_path do | |
execute :touch, 'tmp/restart.txt' | |
end | |
end | |
end | |
after :finishing, 'deploy:restart_passenger' | |
end |
NewerOlder