Skip to content

Instantly share code, notes, and snippets.

View varyform's full-sized avatar

Oleh Khomei varyform

  • Ukraine
  • 01:05 (UTC +03:00)
View GitHub Profile
@dtinth
dtinth / do-you-hear-the-peeople-sing.coffee
Last active August 29, 2015 14:00
Do You Hear the People Sing?
###
# DO YOU HEAR THE PEOPLE SING? (Uplifting Mix)
# version 1.3 (clearer kick sound)
#
# Converted from CoffeeScript
# Source: https://gist.github.com/11080149
# Usage: coffee -bcp file.coffee
#
# Original from Les Miserables
@cwey
cwey / quantize.js
Last active March 22, 2019 01:45 — forked from nrabinowitz/quantize.js
Fixed the two issues reported by leeoniya and by iOSBrett * green is being used again here instead of blue. (line 233) * incorrectly used rval 3 times (line 189)
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php

Когда мы хотим скопировать данные из production окружения Ruby on Rails приложения в development или staging, обычно, нам нужно скопировать дамп базы данных и статические файлы (например, изображения загруженные пользователями). Копирование базы может не представляет проблем (например, ее можно копировать из бэкапов или резервных серверов БД). А вот копирование статических файлов занимает много времени и ресурсов сервера с которого копируют (и на который копируются) файлы.

В рассылке ror2ru Макс Лапшин предложил

@igalic
igalic / Makefile
Created February 13, 2013 08:35
Makefile to create a root-ca, an intermediate signing CA. It can also be used to quickly create keys and Certificates and sign them with that intermediate CA. You should put the root-ca into your Trust Store (preferably as the only CA;) and make sure your programs validate it correctly.
root_DN = /CN=Esotericsystems Root Authority/C=AT/
issuing_DN = /CN=Esotericsystems Issuing Authority/C=AT/
passphrase:
echo -n changeme > $@
#
# Create param files, keys and Self-Signed Certificate for the Root CA
#
root-ca-dsa.param: passphrase
@eric
eric / require_tracking.rb
Created December 28, 2009 02:18
A simple tool to gather memory usage when files are required. More info at: http://bitmonkey.net/post/308322913
#
# Created by Eric Lindvall <eric@sevenscale.com>
#
# WHAT: Provides a simple overview of memory allocation occuring during a
# require.
#
# For a longer explanation, see my post at:
#
# http://bitmonkey.net/post/308322913/tracking-initial-memory-usage-by-file-in-ruby
#
@brianjlandau
brianjlandau / gist:176754
Created August 28, 2009 02:59 — forked from defunkt/gist:162444
Rails Capistrano deploy using git as our deployment strategy. You'll need git version >=1.5.6.6 on your server for this to work.
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, "git@github.com:defunkt/github.git"
set :branch, "origin/master"
set :migrate_target, :current # this tells capistrano where to run the migration. otherwise it would try to use the latest release directory (/path/to/app/releases/2012XXXXXXXXX)
set :use_sudo, false
set :ssh_options, {:forward_agent => true} # so you can checkout the git repo without giving the server access to the repo
set :rails_env, 'production'
# These are here to override the defaults by cap