$ mkdir sopcast
$ cd sopcast
$ wget http://download.sopcast.com/download/sp-auth.tgz
$ tar xzvf sp-auth.tgz
$ sudo cp sp-sc-auth /usr/local/bin/
$ cd ..
$ wget http://www.sopcast.com/download/libstdcpp5.tgz
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
# config/locales/defaults/uk.rb | |
{ | |
uk: { | |
date: { | |
# In Ukrainian month name with day and standalone day are different | |
month_names: lambda do |key, options| | |
if options[:format] && options[:format] =~ /%-?d %B/ | |
:'date.month_names_with_day' | |
else | |
:'date.month_names_standalone' |
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 'net/http' | |
def warning_message | |
puts <<~HEREDOC | |
Usage: | |
$ is_github_down | |
🦄 It's down. Go outside! | |
HEREDOC |
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
module Sinatra | |
module Flash | |
module Style | |
def styled_flash(key=:flash) | |
return "" if flash(key).empty? | |
id = (key == :flash ? "flash" : "flash_#{key}") | |
close = '<a class="close" data-dismiss="alert" href="#">×</a>' | |
messages = flash(key).collect {|message| " <div class='alert alert-#{message[0]}'>#{close}\n #{message[1]}</div>\n"} | |
"<div id='#{id}'>\n" + messages.join + "</div>" | |
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
# -*- encoding: utf-8 -*- | |
require 'sinatra' | |
require 'slim' | |
require 'warden' | |
require 'dm-core' | |
require 'dm-migrations' | |
require 'dm-timestamps' | |
require 'dm-validations' |
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
fi = Float::INFINITY | |
p = 1 | |
p *= 2 while 2**p < fi | |
a = p/2 | |
b = p | |
m = a/2 | |
p = a + m |
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 'twitter' | |
require 'unicode_utils' | |
client = Twitter::Streaming::Client.new do |config| | |
config.consumer_key = "YOUR_CONSUMER_KEY" | |
config.consumer_secret = "YOUR_CONSUMER_SECRET" | |
config.access_token = "YOUR_ACCESS_TOKEN" | |
config.access_token_secret = "YOUR_ACCESS_SECRET" | |
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
#!/usr/local/bin/ruby -w | |
translated_files = Hash.new{ |h, k| h[k] = [] } | |
common_dir = "/en" | |
langs = ['ru', 'uk'] | |
dest_files = ['/en/share/messages/common.properties', '/en/strings/enterprise/service.properties'] | |
langs.each do |lang| | |
dest_files.each do |file| | |
translated_files[lang] << { dest: file } |
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
# encoding: utf-8 | |
require 'pp' | |
require 'open-uri' | |
require 'mechanize' | |
require 'lastfm' | |
require 'vkontakte' | |
### Last.fm credentials | |
# |
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
# encoding: utf-8 | |
# Скрипт для скачування оновлень для програми OPZ (Податкова звітність) | |
require 'net/ftp' | |
require 'logger' | |
local_path = '/home/ftp/opz' | |
log_file = File.open(local_path + '/' + 'opz.log', File::WRONLY | File::APPEND | File::CREAT) |