Skip to content

Instantly share code, notes, and snippets.

@venator85
venator85 / asuswrt-route53.sh
Created January 26, 2017 22:05
Custom AsusWRT DDNS script for AWS Route53
#!/bin/sh
# note: when debugging on PC/MAC, this script must be run with bash
# Custom AsusWRT DDNS script for AWS Route53 - v1.0
# Author: Alessio Bianchi <[email protected]>
# Credits: http://czak.pl/2015/09/15/s3-rest-api-with-curl.html
ACCESS_KEY_ID="XXXXXXXXXXXXXXXXXXXX"
SECRET_ACCESS_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# These keys can be associated to a IAM user with the following policy:
@cryzed
cryzed / fix-infinality.md
Last active July 16, 2025 15:19
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@bheisig
bheisig / pi3_browser-only.md
Last active January 15, 2024 08:05
Run Raspberry 3 in digital signage mode with Chromium Web browser on a TV screen
@mikermcneil
mikermcneil / best-practices-for-passing-the-first-argument-to-an-asynchronous-callback.md
Last active February 11, 2017 19:09
Assuming there was no fatal error, should the first argument to an asynchronous callback be `undefined` or `null`?

Best practices for passing the first argument to an asynchronous callback

When implementing an asynchronous function, you have to think about callbacks. In Node.js, that callback is conventionally written to have two arguments.

tldr: skip ahead

But let's dissect that a bit further. Here are the rules our team guarantees for the callbacks of asynchronous functions we write:

  1. If the first argument is truthy, then you can assume there was a fatal error (something you'd normally use throw to handle, if this was a synchronous function).
  2. If the first argument is truthy, then you shouldn't trust any of the other arguments I send back.
@fernandohu
fernandohu / Reading configuration files before application startup in Angular2 final release.md
Last active July 7, 2024 19:31
Reading configuration files before application startup in Angular2 final release

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

@DonRichards
DonRichards / vagrantFile.md
Last active December 29, 2022 13:33
Conditional Vagrant environments

Conditional Vagrant environments

2 options to start vagrant

command line with pass-through variable or alias

Run while passing variable to vagrantfile

$ ENV='local' vagrant up 

Add an alias

@mikermcneil
mikermcneil / javascript-regular-expressions.md
Last active June 15, 2023 13:23
A basic introduction to regular expressions in JavaScript with a reference of the notation you'll see on a day to day basis.

Regular Expressions in JavaScript: A crash course

I frequently find myself trying to quickly explain the basics of JavaScript regexp, and doing a hasty or incomplete job. Instead, I'm making this. It is by no means a complete reference. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp for that.

Common syntax

Things that match one character
  • . - any character
  • [abc] - any character that matches one of the characters inside the brackets (in this case "a", "b", or "c")
@JonCole
JonCole / Redis-DebuggingKeyspaceMisses.md
Last active March 6, 2025 07:20
Redis Debugging Tips

Debugging Redis Keyspace Misses

Simply put, a keyspace "MISS" means some piece of data you tried to retrieve from Redis was not there. This usually means that one of the following things happened:

  1. The key expired
  2. They key was renamed
  3. The key was deleted
  4. The key was evicted due to memory pressure
  5. The entire database was flushed
  6. The key was never actually inserted
@jcberthon
jcberthon / networkmanager-wifi-powersave.md
Last active July 16, 2025 13:21
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

NetworkManager supports WiFi powersaving but the function is rather undocumented.

From the source code: wifi.powersave can have the following value:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
@slavafomin
slavafomin / nodejs-custom-es6-errors.md
Last active June 3, 2025 17:54
Custom ES6 errors in Node.js

Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.

I've tried to make it as lean and unobtrusive as possible.

Defining our own base class for errors

errors/AppError.js