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
<div class="panel" id="live_check"> | |
<div class="panel-heading text-center"> | |
<h2>Контроль участия</h2> | |
</div> | |
<div class="panel-body"> | |
<p class="question">Вы с нами в прямом эфире ?</p> | |
<%= link_to 'Да', '#', onclick: 'javascript:close_live_check(); return;', class: 'btn btn-info btn-block' %> | |
</div> | |
</div> |
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 social_meta_tags | |
title = "#{(content_for?(:title) ? (strip_tags(content_for(:title)).html_safe + ' / ') : '')}#{t('project_title')}" | |
description = content_for?(:description) ? content_for(:description) : '' | |
image = if @doc.present? | |
image_url(@doc.cover_photo.cover.url) | |
elsif @main.present? | |
image_url(@main.cover_photo.cover.url) | |
else | |
'' | |
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
class ExcelDumper | |
def initialize(array) | |
@data = array | |
end | |
def to_xls(options = {}) | |
output = %{<?xml version="1.0" encoding="UTF-8"?> | |
<Workbook xmlns:x="urn:schemas-microsoft-com:office:excel" | |
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" | |
xmlns:html="http://www.w3.org/TR/REC-html40" |
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/routes.rb | |
YandexKassaIntegration::Application.routes.draw do | |
# ... | |
scope '/yandex_kassa' do | |
controller 'yandex_kassa', constraints: { subdomain: 'ssl' } do | |
post :check | |
post :aviso | |
get :success | |
get :fail |
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
x = [false, *(1..7), nil, 9] | |
.map(&:object_id) | |
.map { |i| i / 2 } | |
.select { |i| i % 2 } | |
.sum | |
.+(STDOUT.fileno) |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
func showMessage(message : String, delay : NSTimeInterval, color : UIColor, completion: boolClosure?) | |
{ | |
dispatch_async(self.GlobalMainQueue) | |
{ | |
guard let window = appDelegate.window else | |
{ | |
completion!(result: false,error: nil) | |
return | |
} | |
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/sh | |
while [ 1 ]; do | |
ffmpeg -re -f concat -i ./$1 -c copy -f flv rtmp://ferry1.irsot.net/bhtvlive/live | |
done |
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/sh | |
wget --content-disposition http://buy-home.tv/admin/reels/playlist | |
FILE=`wget --server-response -q -O - "http://buy-home.tv/admin/reels/playlist" 2>&1 |. | |
grep -i "Content-Disposition:" | tail -1 | awk 'match($0, /filename=(.+)/, f) { print f[1] }' | sed -e 's/^"//' -e 's/"$//'` | |
cd ./tmp | |
youtube-dl -a ../$FILE -f mp4 --skip-download |
NewerOlder