Skip to content

Instantly share code, notes, and snippets.

View stereodenis's full-sized avatar

Denis Evgrafov stereodenis

View GitHub Profile
@beatfactor
beatfactor / install_nginx_macos_source.md
Last active December 3, 2023 13:20
Install Nginx on Mac OS from source (without brew)

Install Nginx on Mac OS from source

no Homebrew required

1. Download Nginx

$ cd /usr/local/src
$ curl -OL http://nginx.org/download/nginx-1.12.2.tar.gz
$ tar -xvzf nginx-1.12.2.tar.gz && rm nginx-1.12.2.tar.gz
@kirankarki
kirankarki / Upgrading rails 5.0 to 5.1
Created October 30, 2017 13:19
Notes on upgrading rails 5.0 to 5.1
1. Change rails version in Gemfile
> gem 'rails', '~> 5.1', '>= 5.1.4'
2. Remove Gemfile.lock
> git rm Gemfile.lock
3. Run bundle install command
> bundle install --jobs=5
4. Run rails' app update to apply changes to app
@thehig
thehig / aggregateDebounce.js
Last active December 7, 2020 07:37
js: Aggregate Debounce
/*
Client wishes to emit a number of actions
Actions are identical RSAAs, with varying meta properties (usually the ID to request)
Ideal scenario
* Numerous actions are taken in within a timeout/debounce window
* After the timeout has expired, the actions are aggregated into a single API call
dispatch({
type: "SOME_FETCH_REQUEST",
numberToCurrency = (number, unit) => {
var precision = 1
var delimiter = ' '
var separator = ','
// return '' if isNaN(number) or not number?
number = number.toFixed(~~precision)
var [i, f] = number.split('.')
var decimals = f > 0 ? separator + f : ''
return i.replace(/(\d)(?=(?:\d{3})+$)/g, '$1' + delimiter) + decimals + (unit || '')
}
@stereodenis
stereodenis / bench
Last active August 29, 2015 14:07
benchmarks
# createdb bench
require 'pg'
require 'active_record'
require 'benchmark'
require 'benchmark/ips'
ActiveRecord::Base.establish_connection(
adapter: 'postgresql',
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')