Skip to content

Instantly share code, notes, and snippets.

View Xunnamius's full-sized avatar
🐕

Bernard Xunnamius

🐕
View GitHub Profile
@staltz
staltz / introrx.md
Last active April 24, 2024 19:47
The introduction to Reactive Programming you've been missing
@paulirish
paulirish / what-forces-layout.md
Last active April 24, 2024 12:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@cthurston
cthurston / mongodb-facet-combine.js
Created November 3, 2017 14:21
MongoDb combine $facet results into a single result set.
db.getCollection('list').aggregate([
{
$facet: {
"events":[{
$match: {
'type': 'Event'
}
}],
"tasks": [{
$match: {
@subfuzion
subfuzion / curl.md
Last active April 23, 2024 14:44
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@skeggse
skeggse / crypto-pbkdf2-example.js
Last active April 17, 2024 21:04
Example of using crypto.pbkdf2 to hash and verify passwords asynchronously, while storing the hash and salt in a single combined buffer along with the original hash settings
var crypto = require('crypto');
// larger numbers mean better security, less
var config = {
// size of the generated hash
hashBytes: 32,
// larger salt means hashed passwords are more resistant to rainbow table, but
// you get diminishing returns pretty fast
saltBytes: 16,
// more iterations means an attacker has to take longer to brute force an

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@lepiaf
lepiaf / unbound.conf
Last active April 3, 2024 21:36
Unbound configuration IPv4 and IPv6
server:
interface: 0.0.0.0
interface: ::0
access-control: 192.168.42.0/24 allow
access-control: 127.0.0.0 allow
access-control: 2001:db8:dead:beef::/48 allow
# unbound optimisation
num-threads: 4
@ThomasLeister
ThomasLeister / rspamd-whitelisting.md
Last active March 20, 2024 19:31
How to whitelist IP addresses or domains in Rspamd

Whitelist IP addresses based on pre-filter policy

/etc/rspamd/local.d/multimap.conf:

  IP_WHITELIST {
      type = "ip";
      prefilter = true;
      map = "/${LOCAL_CONFDIR}/local.d/ip_whitelist.map";
 action = "accept";
@fnando
fnando / dev.conf
Created July 23, 2011 09:00
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
@Xunnamius
Xunnamius / pz_sp_mod_order.md
Last active February 10, 2024 23:58
Mod load order for Project Zomboid 41

You can skip combing through these settings and copying them over one-by-one if you instead place/overwrite the saved_modlists.txt and modmanager-mods.txt files into your C:\Users\(your username)\Zomboid\Lua folder. When you next start the game, load the "Essential" mod preset in the game's Mods menu for a Single Player game. Load the "Multiplayer" mod preset if you're playing on my server.

These mods are listed in ascending order of priority, meaning mod #1 must have lowest relative priority (i.e. nearest the top of your mod load order list) and will have any conflicting code be overridden by the mods that come after it.

For map mods, however, this is reversed! The map mod that loads first claims its cells first, meaning it has the highest priority. This is why St. Bernard's Hill is the last map mod in its block but Common Sense is