Skip to content

Instantly share code, notes, and snippets.

View georgismitev's full-sized avatar

Georgi Mitev georgismitev

View GitHub Profile
require 'pry'
umgi_dir = "/Volumes/OS/interlaced"
files = Dir.glob("#{umgi_dir}/**/*.mp4")
files.each do |f|
result = [f]
ffmpeg_command = "ffmpeg -filter:v idet -frames:v 500 -an -f rawvideo -y /dev/null -i #{f} 2>&1 | awk -F 'detection: ' '/detection/ { print $2 }'"
ffmpeg_result = `#{ffmpeg_command}`
if ffmpeg_result
result_lines = ffmpeg_result.split("\n")
result_lines.each do |l|
// Url.js from https://github.com/Mikhus/jsurl
function isiOS() {
return navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false;
}
function isSafari() {
var ua = navigator.userAgent.toLowerCase();
return (ua.indexOf('safari') !== -1) && ua.indexOf('chrome') === -1;
}
"googleanalytics","google-analytics.com/ga.js"
"quantcast",".quantserve.com/quant.js"
"comscore","http://int.sitestat.com/comscore/"
"omniture","<!-- SiteCatalyst"
"facebook","<meta property=""fb:app_id"" conten"
"chartbeat","static.chartbeat.com/js/chartbeat.js"
"googleecom","google_conversion_id"
"floodlight","https://fls.doubleclick.net/activityi"
"nielsen","imrworldwide.com"
"webtrends","dcsMultiTrack"
require 'cherti/all'
include Cherti
def create_ad_url_override(user_id, ad_url, lang='ad')
device_types = ['mobile', 'tablet', 'pc']
device_types.each do |dt|
AdUrl.find_or_create(:auth_provider => User[user_id].auth_provider, :device_type => dt, :lang => lang, :url => ad_url)
end
end
# folder content
# -rw-r--r--@ 1 G staff 1275020804 3 Sep 10:55 package.box
# vagrant box remove package # if needed remove all files from virtual box
# vagrant setup
vagrant box add package package.box
vagrant init package
vagrant up
vagrant ssh
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
bg:
devise:
confirmations:
confirmed: "Вашият профил беше успешно потвърден. Влязохте успешно в него."
send_instructions: "Ще получите писмо с инструкции как да потвърдите вашия профил до няколко минути."
send_paranoid_instructions: "Ако вашият имейл адрес съществува в базата ни, ще получите там инструкции как да потвърдите вашия профил."
failure:
already_authenticated: "Вече сте влязъл в профила си."
require 'rblineprof'
module Rblineprof
module ConsoleHelpers
include Rblineprof::Helpers
def lineprof_block(options = {}, &block)
profile = lineprof(rblineprof_profiler_regex(options[:lineprofiler])) do
ret = yield
end
require 'Benchmark'
def balanced_delimiters?(text)
openers = []
matchers = {
')' => '(',
']' => '[',
'}' => '{'
}
text.chars.each do |char|