Skip to content

Instantly share code, notes, and snippets.

@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active May 23, 2024 18:38
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

@sam-heller
sam-heller / postman-cloudflare-migadu.js
Last active August 3, 2022 09:05
Provision Migadu Email to a Cloudflare domain via Postman
//Parent Request to https://api.cloudflare.com/client/v4/zones/**zone_id**/dns_records?type=mx,txt,cname,srv
const current_zone = ''; //Zone ID
const verify_code = ''; //value from the hosted-email-verify TXT entry supplied by Migadu
const host = ''; //Hostname
const cloudflare_token = ''; //Cloudflare API Token
const base_url = 'https://api.cloudflare.com/client/v4';
const dns_records_url = base_url + '/zones/' + current_zone + '/dns_records/';
request = {header: {"Authorization" : "Bearer " + cloudflare_token,"Content-Type" : "application/json"}};
const updates = [
@dev-sareno
dev-sareno / android-google-chrome-remote-devices-without-usb-cable.md
Last active December 4, 2023 14:44
Android Google Chrome Remote Devices Without USB Cable (Windows 10)

Android Google Chrome Remote Devices Without USB Cable

Requirments

Steps

  • Open terminal (CMD etc.)
  • Navigate to adb executable $ cd C:\Users\devsareno\AppData\Local\Android\Sdk\platform-tools
@kriegsman
kriegsman / CircusMarquee.ino
Created April 20, 2018 17:10
CircusMarquee - marquee lights as found around the edge of a circus, carnival, or theatre sign
#include "FastLED.h"
// Lights that chase around the outside of a sign, as found
// at carnivals, circuses, and theatres.
#define NUM_LEDS 35
#define LED_TYPE WS2811
#define COLOR_ORDER RGB
#define DATA_PIN 3
@antirez
antirez / lmdb.tcl
Created April 28, 2017 15:40
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
@ronys
ronys / pwsafe-cli-enhancements.md
Last active April 7, 2020 10:37 — forked from sauravg/ pwsafe-cli-enhancements.md
Add more functionality to PasswordSafe CLI

Add more functionality to PasswordSafe CLI

  1. New Actions
  2. Multi-safe operations

1. New Actions

Create a new safe

pwsafe-cli newsafe.psafe3 --new

@kriegsman
kriegsman / TwinkleFOX.ino
Last active January 9, 2024 02:20
TwinkleFOX: Colored Twinkling Holiday Lights
#include "FastLED.h"
#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define NUM_LEDS 100
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
@royshouvik
royshouvik / remoteDebugging.md
Last active April 30, 2024 07:20
Describes how to setup remote debugging on an Android device using Chrome

Remote Debugging on Android with Chrome

The way your web content behaves on mobile can be dramatically different from the desktop experience. Remote debugging with Chrome DevTools lets you debug live content on your Android device from your development machine.

Debugging Chrome for Android using the Chrome Developer Tools

Remote debugging on Android supports:

  • Debugging websites in browser tabs.
  • Debugging WebViews in native Android apps.
@kriegsman
kriegsman / MapTwinkle.ino
Created August 25, 2015 21:09
MapTwinkle- randomly twinkle pixels up from a base color to a peak color and back down.
#include "FastLED.h"
// MapTwinkle
// Designed to illuminate a 'map' of pixels, each of which randomly
// sometimes twinkles brighter and then back down to it's base color again.
//
// Parameters include: background color, peak twinkle color, and speed
// of brightening and dimming.
//
// Mark Kriegsman, August 2015
@macmladen
macmladen / rsync.sh
Last active August 11, 2023 22:43
rsync exclude patterns
# /dir/ means exclude the root folder /dir
# /dir/* means get the root folder /dir but not the contents
# dir/ means exclude any folder anywhere where the name contains dir/
# Examples excluded: /dir/, /usr/share/mydir/, /var/spool/dir/
# /dir means exclude any folder anywhere where the name contains /dir
# Examples excluded: /dir/, /usr/share/directory/, /var/spool/dir/
# /var/spool/lpd//cf means skip files that start with cf within any folder within /var/spool/lpd
#
# include, +
# exclude, -