Skip to content

Instantly share code, notes, and snippets.

View oshanz's full-sized avatar
🌴
On vacation

Oshan Wisumperuma oshanz

🌴
On vacation
View GitHub Profile
@oshanz
oshanz / tips
Created February 2, 2020 07:42
sass
1. usefulness and usability
@oshanz
oshanz / Typhoeus parellel bug
Created January 30, 2020 08:06
Typhoeus parellel bug
module SisExports
class AssessmentsDataSource
def call(assessment_ids = [], fields = [], references = false, sis_token = nil)
hydra = Typhoeus::Hydra.new
batch_size = 100
master_key = fetch_master_key(assessment_ids, sis_token, fields, references)
requests = assessment_ids.each_slice(batch_size).map do |ids|
request = Typhoeus::Request.new(
assessments_url,
method: :post,
@oshanz
oshanz / how to contribute to ruby
Created January 20, 2020 07:50
how to contribute to ruby
* https://kirshatrov.com/2020/01/11/contributing-to-mri/
summary
----
* learn make, autoconf
* docker makes life easy + vscode dev container
Dockerfile
```
FROM ubuntu:latest
# tools you need to build MRI
@oshanz
oshanz / High performance tuning of Nginx
Created January 13, 2020 12:51 — forked from perusio/gist:2154235
High performance tuning of Nginx
## From a post on the ML, apropos this:
## http://lowlatencyweb.wordpress.com/2012/03/20/500000-requestssec-modern-http-servers-are-fast.
## For sysctl.conf
net.ipv4.tcp_slow_start_after_idle = 0
echo "2048 64512" > /proc/sys/net/ipv4/ip_local_port_range
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse
@oshanz
oshanz / delayed_job@.service
Created January 6, 2020 12:59 — forked from stevensona/delayed_job@.service
systemd unit file for running ruby/rails delayed_job as service
# Keep delayed job workers running using systemd on ubuntu
# Usage
# Start "sudo systemctl start delayed_job@{0..3}" to start 4 worker instances
# Enable "sudo systemctl enable delayed_job@{0..3}" to enable 4 worker instances
# Restart "sudo systemctl restart delayed_job@{0..3}" to restart 4 worker instances
# Disable "sudo systemctl disable delayed_job@{0..3}" to disable 4 worker instances
# Stop "sudo systemctl stop delayed_job@{0..3}" to stop 4 worker instances
[Unit]
Description=Delayed Job Worker %i
@oshanz
oshanz / html admin templates
Last active January 5, 2020 04:33
html admin templates
elixir
https://github.com/mojotech/torch
https://github.com/smpallen99/ex_admin
rails
https://github.com/thoughtbot/administrate
html
https://github.com/pratikborsadiya/vali-admin
https://github.com/tabler/tabler - small form elements
@oshanz
oshanz / research
Last active June 6, 2020 08:14
CVD atherosclerosis
# overall
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3459726/
http://www.onlinejacc.org/content/accj/early/2019/03/07/j.jacc.2019.03.010.full.pdf
# plaque
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3209544/
# Inflammation
https://www.nejm.org/doi/full/10.1056/NEJMoa1809798
https://www.nejm.org/doi/full/10.1056/NEJMe1709904
@oshanz
oshanz / parallax effect
Created July 1, 2019 03:23
hugo themes
+ menu
https://themes.gohugo.io/theme/airspace-hugo/
https://themes.gohugo.io//theme/hugo-universal-theme/
https://themes.gohugo.io//theme/hugo-myportfolio-theme/#
+ timeline
https://themes.gohugo.io//theme/agency/#page-top
+ effects
https://themes.gohugo.io/theme/creative/
@oshanz
oshanz / parallel request
Last active June 29, 2019 06:54
ruby http clients
* lib curl
https://github.com/taf2/curb
https://github.com/toland/patron
https://github.com/typhoeus/typhoeus
*http2
https://github.com/igrigorik/http-2
https://github.com/ostinelli/net-http2
* reviews