Skip to content

Instantly share code, notes, and snippets.

View saiury92's full-sized avatar
🎯
Focusing

Khánh Thiện saiury92

🎯
Focusing
View GitHub Profile
version: '3.2'
services:
localstack:
image: localstack/localstack:latest
container_name: localstack_demo
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
environment:
- SERVICES=s3
@saiury92
saiury92 / fixup.sh
Created April 27, 2021 09:49 — forked from stepankuzmin/fixup.sh
Git alias for squashing last N commits into it's parents
git config --global alias.fixup "\!f(){ git reset --soft HEAD~${1} && git commit --amend -C HEAD; };f"
git fixup 1 # squashes last commit into it's parent
#include <stdio.h>
#include <curl/curl.h>
/*
* This is an example showing how to get a single file from an FTP server.
* It delays the actual destination file creation until the first write
* callback so that it won't create an empty file in case the remote file
* doesn't exist or something else fails.
*/
https://images.pexels.com/photos/3981482/pexels-photo-3981482.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940
https://images.pexels.com/photos/881583/pexels-photo-881583.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940
https://images.pexels.com/photos/1126956/pexels-photo-1126956.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940
https://images.pexels.com/photos/850804/pexels-photo-850804.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940
https://images.pexels.com/photos/815996/pexels-photo-815996.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940
https://images.pexels.com/photos/323244/pexels-photo-323244.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940
https://images.pexels.com/photos/908884/pexels-photo-908884.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940
https://images.pexels.com/photos/364382/pexels-photo-364382.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940
https://images.pexels.com/photos/950758/pexels-photo-950758.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940
https://images.pexels.com/photos/971267

Typical rails setup with docker+puma+nginx+postgres

Zaid Annas

Devsinc inc. 30/08/2018

Overview

require 'date'
require 'test/unit'
require 'test/unit/ui/console/testrunner'
class TestDate < Test::Unit::TestCase
def test_that_today_is_last_day_of_the_year
assert_equal Date.today, Date.civil(2019, 12, 31)
end
end
$ benchmark-driver benchmark.yml --rbenv '2.0.0::2.0.0-p648 --disable-gems;2.5.3::2.5.3 --disable-gems;2.6.0-preview3::trunk --disable-gems;2.6.0-preview3+JIT::trunk --disable-gems --jit' -v --repeat-count 24
2.0.0: ruby 2.0.0p648 (2015-12-16 revision 53162) [x86_64-linux]
2.5.3: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
2.6.0-preview3: ruby 2.6.0dev (2018-10-31 trunk 65474) [x86_64-linux]
2.6.0-preview3+JIT: ruby 2.6.0dev (2018-10-31 trunk 65474) +JIT [x86_64-linux]
Calculating -------------------------------------
2.0.0 2.5.3 2.6.0-preview3 2.6.0-preview3+JIT
Optcarrot Lan_Master.nes 34.548 48.314 54.535 85.690 fps
Comparison:
@saiury92
saiury92 / ssl_puma.sh
Created June 28, 2018 08:13 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@saiury92
saiury92 / gist:fb11b8787e8d5efcae23e8e5c2a5886f
Created March 2, 2018 07:08 — forked from mrtns/gist:78d15e3263b2f6a231fe
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
var _ = require('lodash')
, AWS = require('aws-sdk')
, path = require('path')
, url = require('url');
function encodeSpecialCharacters(filename) {
// Note: these characters are valid in URIs, but S3 does not like them for
// some reason.
return encodeURI(filename).replace(/[!'()* ]/g, function (char) {
return '%' + char.charCodeAt(0).toString(16);