Skip to content

Instantly share code, notes, and snippets.

View cassio-maletich's full-sized avatar
🌎

Cássio Maletich cassio-maletich

🌎
View GitHub Profile
@mrmartineau
mrmartineau / stimulus.md
Last active April 25, 2026 07:43
Stimulus cheatsheet
@vojtasvoboda
vojtasvoboda / .gitlab-ci.yml
Last active December 5, 2020 16:29
GitLab CI FTP deploy with mwienk/docker-lftp docker image
stages:
- test
- deploy
cache:
paths:
- vendor
# test job
test:
@kivanio
kivanio / token.rb
Created December 22, 2016 17:53 — forked from GregBaugues/token.rb
Google API OAuth 2.0 refresh token (Ruby on Rails)
# The OAuth access token provided by the Google API expires in 60 minutes. After expiration,
# you must exchange a refresh token for a new access token. Unfortunately, the the Google API
# ruby gem does not include a method for refreshing access tokens.
# You can read up on how to refresh an access token here:
# https://developers.google.com/accounts/docs/OAuth2WebServer#refresh
# This Token model implements that process. It's based off of a Token model that can be created
# by running:
# rails g model Token token:text refresh_token:string expires_at:datetime
@vongosling
vongosling / gist:9929680
Last active July 17, 2025 21:28
Performance Tuning

Three system configuration parameters must be set to support a large number of open files and TCP connections with large bursts of messages. Changes can be made using the /etc/rc.d/rc.local or /etc/sysctl.conf script to preserve changes after reboot.

1. /proc/sys/fs/file-max: The maximum number of concurrently open files.

fs.file-max = 1000000

2. /proc/sys/net/ipv4/tcp_max_syn_backlog: Maximum number of remembered connection requests, which are still did not receive an acknowledgment from connecting client. The default value is 1024 for systems with more than 128Mb of memory, and 128 for low memory machines.

net.ipv4.tcp_max_syn_backlog = 3240000

3. /proc/sys/net/core/somaxconn: Limit of socket listen() backlog, known in userspace as SOMAXCONN. Defaults to 128.

net.core.somaxconn = 3240000

@malandrina
malandrina / gist:3745321
Created September 18, 2012 19:35
Anagram solvers for same-length anagrams, in Ruby

Anagram solvers for same-length, single word anagrams, in Ruby

I wanted to write an anagram solver that would return a list of the anagrams of the same length of a given word/combination of characters, such that:

same_length_anagrams("deify") => "edify"

or

same_length_anagrams("ogb") => "bog", "gob"