Skip to content

Instantly share code, notes, and snippets.

Avatar

Staskov Sergey solutus

  • Saint-Petersburg, Russia
View GitHub Profile
@dhh
dhh / Gemfile
Created Jun 24, 2020
HEY's Gemfile
View Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
View Effective_Engineer.md

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

View mysql-5.6-downgrade-to-5.5.sh
#!/bin/sh
export DEBIAN_FRONTEND=noninteractive
sudo rm -rf /etc/apt/sources.list.d/mysql.list
sudo add-apt-repository -y ppa:ondrej/mysql-5.5
sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/remove-data-dir boolean true"
sudo apt-get remove --purge -y mysql-client mysql-common mysql-community-client mysql-community-server mysql-server php5-mysql libmysqlclient-dev libmysqlclient18
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo -E bash -c 'apt-get -y --force-yes install mysql-server libmysqlclient-dev'
mysqladmin -u root password semaphoredb
@smedstadc
smedstadc / read_only_hash.rb
Created Apr 12, 2015
Read Only Ruby Hash Snippet
View read_only_hash.rb
# By extending a regular ruby hash with this module the hash will behave as if
# it were an immutable object. The brackets and fetch methods will return copies
# of values and the assignment method will raise an exception.
#
# Other methods that should be redefined for a truly immutable hash object.
# :delete, :delete_if, :reject!, :select!, :keep_if, :merge!, :update
module ReadOnlyHash
def [](key)
value = super(key)
value ? value.dup : default
@synasius
synasius / init.vim
Last active Dec 5, 2021
neovim configuration
View init.vim
" vim:foldmethod=marker:foldlevel=0
" vim-plug {{{
call plug#begin()
" color scheme
Plug 'chriskempson/base16-vim'
" syntax highlighting
Plug 'peterhoeg/vim-qml'
@adamloving
adamloving / show-express-routes-gulp-task.js
Created Jun 9, 2014
Gulp task to show the routes in an express app (similar to rails rake routes).
View show-express-routes-gulp-task.js
var app = require('../server/app.js').create()
var gulp = require('gulp');
var task = require('./index');
/*
Output all the routes that the app supports
*/
gulp.task('routes', function() {
@lttlrck
lttlrck / gist:9628955
Created Mar 18, 2014
rename git branch locally and remotely
View gist:9628955
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@mgreenly
mgreenly / gist:1109325
Created Jul 27, 2011
database cleaner multiple connections single orm outside of rails
View gist:1109325
RSpec.configure do |config|
config.before(:suite) do
ActiveRecord::Base.establish_connection database['one']
DatabaseCleaner.strategy = :deletion
ActiveRecord::Base.establish_connection config.database['two']
DatabaseCleaner.strategy = :deletion
end
config.before(:each) do