This file contains hidden or 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
| dump_file = "#{app_dir}/shared/tulp.dump" | |
| cookbook_file dump_file do | |
| source "tulp.dump" | |
| owner node["tulp"]["application"]["application_user"] | |
| group node["tulp"]["application"]["application_user"] | |
| end | |
| execute "default database" do | |
| command "psql -h #{postgresql_master_server} tulp < #{dump_file}" |
This file contains hidden or 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
| related_path = ->(poster) { '/system/data/' + q.poster.send(:hashed_path) } | |
| remote_path = -> (p) { '/srv/tulp-application/shared' + related_path[p] } | |
| local_path = ->(p) {'/srv/tulp-application/shared/public' + related_path[p] } | |
| %x[mkdir -p #{local_path[q]} && scp -r tulp@backend02.tulp.ru:#{remote_path[a]} #{local_path[q]}] |
This file contains hidden or 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
| #_ собственно, сам укус. Почти незаметный. | |
| (defn my-comp [& f] #((reduce (fn [x j] [(apply j x)]) %& (into () f)) 0)) | |
| (= true ((my-comp zero? #(mod % 8) +) 3 5 7 9)) |
This file contains hidden or 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
| source "https://rubygems.org" | |
| gem "sqlite3" | |
| gem "datamapper" | |
| gem "dm-sqlite-adapter" | |
| gem "mechanize" | |
| gem "pry" | |
| gem "em-synchrony" | |
| gem 'em-http-request' |
This file contains hidden or 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
| ; call trello2org interactively | |
| ; or pragmatically like this: (trello2org "c:/Users/jfurtney/blo-up-2-7.json") | |
| (require 'json) | |
| (defun convert-trello-json-file-to-org (trello-json-file) | |
| (let* ((board (json-read-file trello-json-file)) | |
| (board-name (cdr (assoc 'name (cdr board)))) | |
| (lists (cdr (assoc 'lists (cdr board)))) |
This file contains hidden or 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
| ( ($) -> | |
| $.fn.outclick = (func) -> | |
| clickHandler = (e) => | |
| console.log e | |
| unless e.target == @ or $(e.target).parents().is(@) | |
| @.trigger('outclick') | |
This file contains hidden or 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 PB::SocialNetwork::Base | |
| def self.included base | |
| @networks << base | |
| base.extend ClassMethods | |
| base.include InstanceMethods | |
| # другая инициализация | |
| end |
This file contains hidden or 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
| # standard capistrano config goes here.... | |
| # Prettify output to console | |
| logger.level = Capistrano::Logger::IMPORTANT | |
| STDOUT.sync | |
| before "deploy:web:disable" do print "\e[34m-->\e[0m Put maintenance sreen......."; end | |
| after "deploy:web:disable" do puts "[\e[32m✓\e[0m]"; end |
This file contains hidden or 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 CarrierWave | |
| module FFMPEG | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| def faststart | |
| process :faststart => true | |
| end | |
| def transcode options |
This file contains hidden or 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
| import Data.List (sort) | |
| import Data.Maybe (isJust, fromJust) | |
| checkWords :: [[String]] -> String | |
| checkWords [] = "Can't match" | |
| checkWords (xs:ys) | length xs == 1 = head xs | |
| | otherwise = checkWords ((unfold (trans (head xs)) (tail xs)) ++ ys) | |
| where trans x y | head x == last y = Just (y ++ x) | |
| | head y == last x = Just (x ++ y) | |
| | otherwise = Nothing |