Skip to content

Instantly share code, notes, and snippets.

View nazariyv's full-sized avatar
🔭
You study mathematics because it is the poetry of the universe

naz nazariyv

🔭
You study mathematics because it is the poetry of the universe
View GitHub Profile
@cwhinfrey
cwhinfrey / bridge_hacks.md
Last active July 1, 2024 17:53
Bridge Hack List

@preston_vanloon's plugins

Be sure to watch the YouTube stream where we talk about how these plugins work in depth.

These two plugins helped me get into the top 10 of the dark forest score contest for v0.5.

auto-conquer is a plugin that would find the best planets to conquer. It is currently tweaked for late game, so you'll have to read the code and change parameters if you are just starting out!

auto-silver is a plugin to re-distribute silver mines to available planets. It's also tweaked for late game, ignoring silver mines with small amounts of silver.

@simbo1905
simbo1905 / PwnedPaswordsMongoDB.md
Last active July 10, 2023 02:50
How To Load The HIBP Pwned Passwords Database Into MongoDB

How To Load The HIBP Pwned Passwords Database Into MongoDB

NIST recommends that when users are trying to set a password you should reject those that are commonly used or compromised:

When processing requests to establish and change memorized secrets, 
verifiers SHALL compare the prospective secrets against a list that 
contains values known to be commonly-used, expected, or compromised.

But how do you know what are the compromised passwords? Luckily Troy Hunter put a lot of effort into building the "Have I Been Pwned (HIBP)" database with the SHA1 hashes of 501,636,842 passwords that have been compromised on the internet. Sweet.

@ezynda3
ezynda3 / wtf-ethclient.go
Created January 2, 2018 13:58
Golang Ethereum Connection Example
package main
import (
"context"
"fmt"
"log"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
)
@excavador
excavador / README.md
Last active November 6, 2022 21:48
automatically add alias ip address to loopback

Motivation

You often have several docker containers and applications which work together in the locel development environment. You need the following communications:

  • docker container to localhost
  • localhost to docker container
  • docker container to docker container

You have a way to connect localhost-to-docker using -p (port-mapping) docker option. For instance, you can start PostgreSQL container using -p 0.0.0.0:5432:5432 and then connect like to normal PostgreSQL

@kn9ts
kn9ts / GPLv3.md
Last active July 3, 2024 08:19
GPLv3 explained

GPL3 LICENSE SYNOPSIS

TL;DR* Here's what the license entails:

1. Anyone can copy, modify and distribute this software.
2. You have to include the license and copyright notice with each and every distribution.
3. You can use this software privately.
4. You can use this software for commercial purposes.
5. If you dare build your business solely from this code, you risk open-sourcing the whole code base.
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@amcgregor
amcgregor / gist:405354
Last active June 15, 2020 16:35
Python timeit benchmarking for realistic optimizations.
# All units in usecs (µsec) comparing Python 2.7 | 3.7.
# Last updated: 2019-02-11
# MacBook Pro (15-inch, 2016)
# macOS 10.14.3
# 2.7 GHz Intel Core i7
# 16 GB 2133 MHz LPDDR3
python -m timeit "200 <= 250 < 300" # 0.0354 | 0.059
python2.7 -m timeit "250 in xrange(200, 300)" # 1.25