Skip to content

Instantly share code, notes, and snippets.

View jin-zhe's full-sized avatar

Jin Zhe jin-zhe

View GitHub Profile
@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')
@sunny
sunny / gif_processes.rb
Last active May 5, 2019 11:24
Addon to CarrierWave to process GIF files.
# frozen_string_literal: true
require "rmagick"
# Addons to CarrierWave to process GIF files.
#
# Example:
#
# class AvatarUploader < CarrierWave::Uploader::Base
# include CarrierWave::GifProcesses
@leandromoreira
leandromoreira / nginx.conf
Last active November 29, 2023 11:39
nginx.conf optmized for http/2 = HTTPS TLS (ssl)
# command to generate dhparams.pen
# openssl dhparam -out /etc/nginx/conf.d/dhparams.pem 2048
limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m;
limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=5r/s;
limit_req_status 444;
limit_conn_status 503;
proxy_cache_path /var/lib/nginx/proxy levels=1:2 keys_zone=backcache:8m max_size=50m;
proxy_cache_key "$scheme$request_method$host$request_uri$is_args$args";