Skip to content

Instantly share code, notes, and snippets.

View abelorian's full-sized avatar
🎯
Focusing

Abel O'Rian abelorian

🎯
Focusing
View GitHub Profile
@abelorian
abelorian / gist:96fcbb44503dc71eb83cbacc00400deb
Created July 16, 2020 17:13 — forked from brianr/gist:82ff15b17c839ff14748
Rollbar RQL: Search for occurrences in last 24 hours by url pattern
select *
from item_occurrence
where timestamp >= unix_timestamp() - 24 * 60 * 60
and request.url like '%mydomain.com%'
@abelorian
abelorian / Gemfile
Created June 25, 2020 15:11 — forked from dhh/Gemfile
HEY's 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
@abelorian
abelorian / gist:1f31f19726270ceb2f2bfacabf3abcdb
Created June 22, 2020 14:21 — forked from luckydev/gist:b2a6ebe793aeacf50ff15331fb3b519d
Increate max no of open files limit in Ubuntu 16.04/18.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf
@abelorian
abelorian / readme.md
Last active November 4, 2019 20:23 — forked from yosukehasumi/readme.md
DigitalOcean Rails/Ubuntu/NGINX (16.04) Setup

DigitalOcean Rails/Ubuntu/NGINX (16.04) Setup

  1. Setup
  2. Swapfile
  3. NGINX
  4. ElasticSearch
  5. RVM
  6. Rails
  7. Postgres
  8. Capistrano
References:
http://blog.carbonfive.com/2012/02/27/supporting-cross-domain-ajax-in-rails-using-jsonp-and-cors/
https://github.com/cyu/rack-cors
http://nelm.io/blog/2011/11/cors-with-sencha-touch/
http://jessehowarth.com/2011/04/27/ajax-login-with-devise
=============================================================================================================
GEMFILE
=============================================================================================================
gem 'rack-cors', :require => 'rack/cors'
@abelorian
abelorian / random.js
Last active August 29, 2015 14:06 — forked from kerimdzhanov/random.js
// @return [float] a random number between min and max
function getRandom(min, max) {
return Math.random() * (max - min) + min;
}
// @return [integer] a random int between min and max
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}