Skip to content

Instantly share code, notes, and snippets.

@amfathi
amfathi / BaseNavigationCoordinator.swift
Last active May 8, 2024 18:09
Coordinator (NavigationCoordinator + TabBarCoordinator)
import UIKit
// MARK: - Base Coordinator
class NavigationCoordinator: NSObject, Coordinator {
weak var parentCoordinator: Coordinator?
var childCoordinators = [Coordinator]()
var navigationController: BaseNavigationController
weak var startViewController: UIViewController?
@linucksrox
linucksrox / docker-compose.yml
Created November 21, 2023 18:49
Unifi Network Application 8.0.7 with mongodb - docker-compose.yml
version: '3.7'
services:
unifi-db:
image: docker.io/mongo:latest
container_name: unifi-db
volumes:
- ./data:/data/db
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
@lornajane
lornajane / mac.md
Last active May 8, 2024 18:08
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 8, 2024 18:07
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@cdlewis
cdlewis / iterable.md
Last active May 8, 2024 18:07
Handlebars for Iterable

Chris' Iterable Handlebars Cheat Sheet

Merge Parameters

Iterable merge paremeters have different brackets depending on whether it's a user object or a feed. These differences extend to functions operating on those parameters. For example, {{if}} needs to be [[if]] when evaluating a feed parameter.

User object

{{firstName}}
@cnicodeme
cnicodeme / fixes.md
Last active May 8, 2024 18:03
List of 5,000 Most Frequently Used Domain Name Prefixes and Suffixes - Ordered By Length
@lopspower
lopspower / README.md
Last active May 8, 2024 18:02
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@spinscale
spinscale / volume.lua
Created April 16, 2017 18:19
Hammerspoon: Configure volume via keyboard shortcuts for macbook pro (touchbar, but no keys)
function changeVolume(diff)
return function()
local current = hs.audiodevice.defaultOutputDevice():volume()
local new = math.min(100, math.max(0, math.floor(current + diff)))
if new > 0 then
hs.audiodevice.defaultOutputDevice():setMuted(false)
end
hs.alert.closeAll(0.0)
hs.alert.show("Volume " .. new .. "%", {}, 0.5)
hs.audiodevice.defaultOutputDevice():setVolume(new)
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active May 8, 2024 17:59
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@endolith
endolith / frequency_estimator.py
Last active May 8, 2024 17:59
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread