Skip to content

Instantly share code, notes, and snippets.

@dagronf
dagronf / CAAnimation+blockCallback.swift
Last active April 18, 2024 18:16
CAAnimation extension with starting/completion callback blocks
//
// CAAnimation+BlockCallback.swift
//
import UIKit
//
// Modified from http://onedayitwillmake.com/blog/2016/06/caanimation-completion-callback-block/
// Updated for Swift 4 syntax
// All credit to the original author (Mario Gonzalez)
@Fantailed
Fantailed / supernote_template_tips.md
Last active April 18, 2024 18:15
Supernote A6X2 Nomad Template Mockup + Template Creation Workflow Tips

Supernote A6X2 Nomad Template Mockup + Template Creation Workflow Tips

Downloads

Mockup

Affinity: Download .aftemplate
Photoshop (PSD export; compatibility not guaranteed): Download .psd

@jrade
jrade / FastExp.h
Created March 19, 2021 06:09
Fast approximate exponential function
// Copyright 2021 Johan Rade (johan.rade@gmail.com)
// Distributed under the MIT license (https://opensource.org/licenses/MIT)
#ifndef FAST_EXP_H
#define FAST_EXP_H
#include <cstdint>
#include <cstring>
@hypebright
hypebright / shiny-destroy-observer.R
Created March 9, 2024 16:54
Demo demonstrating how to dynamically add and remove Shiny modules, and how to properly clean up modules once removed by using the destroy() method.
# Dynamic UI: demonstrate destroy() method on observer
# This example makes use of a module that dynamically creates pages
# Each server part of the module creates an observer that listens to an actionButton
# Whenever a page is removed, the observer is destroyed. The UI is removed with
# the nav_remove() function.
library(shiny)
library(bslib)
sportsPageUI <- function(id, page_name) {
@bendalby82
bendalby82 / iis-log-file-format-grok.txt
Created September 29, 2020 14:43
Grok rule to parse IIS log file format (a fixed ASCII text-based format that cannot be customized)
%{IP:client_ip},%{SPACE}%{NOTSPACE:username},%{SPACE}%{DATE_US:date},%{SPACE}%{TIME:time},%{SPACE}%{WORD:service},%{SPACE}%{HOSTNAME:server_name},%{SPACE}%{IP:server_ip},%{SPACE}%{INT:time_taken_ms},%{SPACE}%{INT:client_bytes_sent},%{SPACE}%{INT:server_bytes_sent},%{SPACE}%{INT:http_status_code},%{SPACE}%{INT:windows_status_code},%{SPACE}%{WORD:http_request_verb},%{SPACE}%{URIPATH:http_verb_target},%{SPACE}%{NOTSPACE:http_parameters},

Karabiner layouts for symbols and navigation

Gavin Sinclair, January 2022

Introduction

I use Karabiner (configured with Gosu) to make advanced key mappings on my Apple computer. Karabiner allows you to create “layers”, perhaps simulating those on a programmable mechanical keyboard. I make good use of these layers to give me easy access (home-row or nearby) to all symbols and navigational controls, and even a numpad.

The motivation is to keep hand movement to a minimum. Decades of coding on standard keyboards has unfortunately left me with hand and wrist pain. I will soon enough own a small split keyboard which will force me to use layers to access symbols etc., so this Karabiner solution, which has evolved over months, is a training run for that.

@jasco
jasco / README.md
Last active April 18, 2024 18:07
Workaround for SqlAlchemy Alembic Migrations

Dialect specific migration with Alembic

DDL

Certain SQL dialect specific SQL including triggers and stored procedures are not abstracted away by SqlAlchemy. In those cases SqlAlchemy provides a DDL interface that can be connected to events that conditionally trigger the appropriate dialect specific code.

ddl = sqlalchemy.DDL(custom_pg_trigger)

@taiwbi
taiwbi / gnome-transparent-sidebar.css
Last active April 18, 2024 18:06
Make Gnome applications sidebar semi-transparent, and add blur with Blur My Shell Extension if you want to
/* Mohammad Mahdi Tayebi
*
* To apply transparent sidebar. copy this file into ~/.config/gtk-4.0/gtk.css and if
* you use adw-gtk3 theme you can add it to ~/.config/gtk-3.0/gtk.css as well
*
* Use blur my shell extension to add blur effect behind the transparent part of windows
*/
/* Transparent Sidebar */
window {
@xiaozhang1990
xiaozhang1990 / tmux-cheatsheet.markdown
Created April 18, 2024 18:06 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@dragonfire1119
dragonfire1119 / n8n-docker-compose
Last active April 18, 2024 18:05
Docker compose for n8n.io
version: '3'
services:
n8n:
image: docker.n8n.io/n8nio/n8n
ports:
- 5678:5678
environment:
- GENERIC_TIMEZONE=America/Chicago
- TZ=America/Chicago