Skip to content

Instantly share code, notes, and snippets.

@olkeene
olkeene / .profile
Created February 4, 2018 22:24 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
/** @jsx React.DOM */
var ReadingTimeWidget = React.createClass({
getInitialState: function() {
return ({
secondsRequired: null,
});
},
componentWillMount: function() {
var cdiv = this.props.contentDiv;
@olkeene
olkeene / deploy.rb
Created July 28, 2011 17:15 — forked from bradly/deploy.rake
Simple Rails Deployments with Net/SSH
require 'net/ssh'
desc "Deploy site to production"
task :deploy => :environment do
host = 'yourhost.com'
user = 'username'
options = {:keys => '~/.ssh/keys/yourserver.pem'}
remote_path = '/path/to/rails_app'
commands = [
@olkeene
olkeene / Signup.js
Created June 19, 2011 15:38 — forked from mavenlink/fixture_generation_methods.rb
[blog] html fixtures
describe('Validate registration form', function () {
beforeEach(function () {
$(this).ready(function () {
loadSignupFixture()
});
});
it('should validate the form ', function () {
form = $('#user-registration-form')
@olkeene
olkeene / shared_connection.rb
Created May 10, 2011 14:45 — forked from josevalim/shared_connection.rb
Share connection for selenium
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
Дизайнер сдает работу заказчику. Заказчик удовлетворенно кивает,
со всем соглашается:
— Ну, вроде бы все принято!
— Отлично, с вас 1500.
Заказчик, отдавая деньги: «Я надеюсь, если потом нужно будет переправить,
можно обратиться? Это ведь не так, что один раз сделали и забыли?»
— Разумеется, в зависимости от того, что и как нужно
будет исправить.
— Ну конечно! Я же не скажу «Давайте все переделаем»!
— Не вопрос. Кстати, еще один момент. Можно и мне потом, если у меня вдруг
user app;
worker_processes 2;
error_log /home/app/logs/nginx.error.log info;
events {
worker_connections 1024;
}
namespace :translations do
desc "Show available locales"
task :available => :environment do
puts "Available locales: #{I18n.available_locales.join(', ')}"
end
desc "Show missed translations depending on default language environment (:#{I18n.default_locale} by default). You can change it providing LOCALE argument"
task :missed => :environment do
locale = ENV['LOCALE'] || I18n.default_locale
puts "Using :#{locale} as default locale"