Skip to content

Instantly share code, notes, and snippets.

@casecode
casecode / secure-websockets
Last active April 19, 2023 17:50
Basic Config for SSL with Secure Websockets using Nginx 1.6.0 + Puma + Thin
=========================
# /etc/nginx/nginx.conf
=========================
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
@ju2wheels
ju2wheels / docker-compose.yml
Created June 10, 2015 20:11
docker-compose reference YAML file with comments
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
service_name:
@longtimeago
longtimeago / squash-commits.md
Last active April 1, 2024 20:44
How to squash commits in a GitHub pull request

How to squash commits in a GitHub pull request

o you've contributed some code to an open source project, say, Rails. And they'd like you to squash all of the commits in your pull request. But you're not a git wizard; how do you make this happen?

Normally, you'd do something like this. I'm assuming upstream is a git remote that is pointing at the official project repository, and that your changes are in your 'omgpull' branch:

@tyrcho
tyrcho / README.md
Last active November 27, 2021 05:07
Find and recompress from x265 to x264 with ffmpeg
@muhammadghazali
muhammadghazali / What is server_names_hash_bucket_size.md
Last active February 9, 2024 14:13
Nginx: What is server_names_hash_bucket_size?

Background

While I'm learning how to use Nginx, I was instructed to update the server_names_hash_bucket_size (/etc/nginx/nginx.conf) value from 32 to 64, but I don't understand why should I increase the value to 64.

References

References that have been read so far:

@LouisCAD
LouisCAD / MyPreferences.kt
Last active September 14, 2020 17:12
Make Android's SharedPreferences as simple as a field in kotlin.
package com.mypackage.myapp.prefs
import android.content.Context
import com.mypackage.myapp.appCtx
object MyPreferences : Preferences(name = "MyPrefsFileName") {
var userWantsFancyUi by BoolPref(Keys.FANCY_UI, false)
var isFcmTokenSent by BoolPref(Keys.FCM_TOKEN_SENT_TO_SERVER, false)
var eggTapsCount by LongPref(Keys.EGG_TAPS_COUNT, 0L)
@tterb
tterb / README-badges.md
Last active July 3, 2024 13:47
A collection of README badges

Badges

License

MIT License GPLv3 License AGPL License

Version

Version GitHub Release

Overview - Adding support for a new currency in Coinomi

The Coinomi wallet can support any kind of cryptographic currency because it adopts the model of a thin wallet.

A thin wallet will delegate most of the complexity to a trusted server, while still maintaining control of the private keys by using a deterministic key chain BIP44. It is different than SPV in that it doesn't need to perform any header or transaction merkle root validations (although it is optionally possible).

The advantage of a thin wallet is that it is light weight and can easily work with low-specs devices and consumes small amounts of network bandwidth. Some assets like Peercoin, CounterParty or Mastercoin can only work with this model because as SPV is not enough to validate transactions. The disadvantage is that it needs a trusted service to get the state of the network. A known attack for an SPV wallet is to hide transactions, in a thin wallet it is possible to al

@krisleech
krisleech / renew-gpgkey.md
Last active July 10, 2024 14:14
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@ndlrx
ndlrx / dnscrypt-proxy.md
Last active May 15, 2024 09:38
Install dnscrypt-proxy on Archlinux or Manjaro

Step 1 - Install and Configure dnscrypt-proxy

sudo su
pacman -S dnscrypt-proxy
cd /etc/dnscrypt-proxy/