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
| # | |
| # = Capistrano database.yml task | |
| # | |
| # Provides a couple of tasks for creating the database.yml | |
| # configuration file dynamically when deploy:setup is run. | |
| # | |
| # Category:: Capistrano | |
| # Package:: Database | |
| # Author:: Simone Carletti <[email protected]> | |
| # Copyright:: 2007-2010 The Authors |
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
| require 'rubygems' | |
| require 'eventmachine' | |
| require 'em-websocket' | |
| require 'json' | |
| class Connection | |
| attr_accessor :socket, :user_id | |
| def initialize(socket, user_id) | |
| @socket = socket |
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
| # NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
| $ cd /usr/src | |
| $ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
| $ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
| $ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
| $ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
| $ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
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
| GitHub.TreeSlider = function () { | |
| if (window.history && window.history.pushState) { | |
| function a() { | |
| if (e.sliding) { | |
| e.sliding = false; | |
| $(".frame-right").hide(); | |
| $(".frame-loading:visible").removeClass("frame-loading") | |
| } | |
| } | |
| if (!($("#slider").length == 0 || !GitHub.shouldSlide)) if (!navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { |
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
| # usage: | |
| # bundle exec rake locale:file RAILS_ENV=production | |
| # if you want to export a different locale (not en.yml), provide locale option, as follows: | |
| # bundle exec rake locale:file RAILS_ENV=production locale=ru | |
| require 'mongo-i18n' | |
| def write_to_database(sc, path, value) | |
| key = path.join('.') | |
| sc[key] = value.to_json |
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
| namespace :log do | |
| desc "A pinch of tail" | |
| task :tailf, :roles => :app do | |
| run "tail -n 10000 -f #{shared_path}/log/#{rails_env}.log" do |channel, stream, data| | |
| puts "#{data}" | |
| break if stream == :err | |
| end | |
| 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
| class WebSocketRPC | |
| constructor: (host) -> | |
| @callbacks = {} | |
| @id = 0 | |
| @socket = new WebSocket(host) | |
| @socket.onopen = @onopen | |
| @socket.onmessage = @onmessage | |
| @socket.onclose = @onclose | |
| onopen: => |
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
| class CarElement | |
| def accept(visitor) | |
| raise NotImpelementedError.new | |
| end | |
| end | |
| module Visitable | |
| def accept(visitor) | |
| visitor.visit(self) | |
| 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
| #!/bin/sh | |
| # build_fat.sh | |
| # | |
| # Created by Robert Carlsen on 15.07.2009. Updated 24.9.2010 | |
| # build an arm / i386 lib of standard linux project | |
| # | |
| # initially configured for tesseract-ocr v2.0.4 | |
| # updated for tesseract prerelease v3 | |
| outdir=outdir |
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
| # Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |
OlderNewer