Skip to content

Instantly share code, notes, and snippets.

{
"version": 1.2,
"mode": "wall",
"frames":
{
"91": {"name": "Alexey"},
"92": {"name": "Improves"},
"93": {"name": "Intellectual"},
"94": {"name": "Physical"},
"95": {"name": "English"},
# rubocop branch
[TEST PROF INFO] Time spent in factories: 06:30.926 (43.32% of total time)
[TEST PROF INFO] Factories usage
Total: 70847
Total top-level: 48720
Total time: 06:30.926 (out of 15:20.675)
Total uniq factories: 495
total time time per 1000 total top-level top-level time name
[TEST PROF INFO] Time spent in factories: 06:30.768 (44.67% of total time)
[TEST PROF INFO] Factories usage
Total: 73231
Total top-level: 51117
Total time: 06:30.768 (out of 14:55.623)
Total uniq factories: 495
total time time per 1000 total top-level top-level time name
[TEST PROF INFO] Factories usage
Total: 147541
Total top-level: 53062
Total time: 14:35.193 (out of 27:03.571)
Total uniq factories: 495
total time time per 1000 total top-level top-level time name
458.9056s 16.4428s 23963 7674 126.1821s user
@spajic
spajic / promises.md
Created May 12, 2018 14:02 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@spajic
spajic / README.md
Created May 4, 2018 11:01 — forked from githubutilities/README.md
Shadowsocks proxy and ssh proxy

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@spajic
spajic / shadowsocks_ssh
Created April 30, 2018 20:42 — forked from gnepud/shadowsocks_ssh
shadowsocks / ssh proxy
----- shadowsocks ------
server
easy_install pip
pip install shadowsocks
vi /etc/shadowsocks.json
{
"server":"server_ip",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
BENCHMARKING RESULTS:
Total time: 160.870763s
Total assets processed: 1501
Top 30 time-consuming assets:
72.39607 - /Users/spajic/busfor/app/assets/javascripts/new/application.js.erb (filter)
11.028339 - new/application.flybus.css (path)
10.956602 - /Users/spajic/busfor/app/assets/javascripts/application.js (filter)
9.900653 - active_admin.js (path)
BENCHMARKING RESULTS:
Total time: 145.70521s
Total assets processed: 522
Top 30 time-consuming assets:
72.118234 - new/application.js (path)
12.927754 - application.js (path)
11.216744 - new/application.css (path)
9.419542 - new/application.flybus.css (path)
@spajic
spajic / audit_report.rb
Created June 16, 2017 12:59
Get audit report for given field of a given object
audited_object = Domain.find_by_name('staging.busfor.by')
audited_object.audits.each do |audit|
was = audit[:audited_changes]['config'].first['no_index']
became = audit[:audited_changes]['config'].last['no_index']
if was != became
puts "#{audit.created_at}: #{audit.user&.email}: #{was}->#{became}"
end
end