Skip to content

Instantly share code, notes, and snippets.

@indygreg
indygreg / Apple Bug Report
Last active November 9, 2022 15:53
Slow readdir() or lstat() behavior for parallel directory walks
(This is the content of https://bugreport.apple.com/web/?problemID=45648013.)
Area:
Something not on this list
Summary: Calling readdir() from multiple threads apparently acquires a global kernel lock, making directory traversal operations from multiple processes extremely slow as the number of parallel I/O operations increases.
Steps to Reproduce:
@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active February 7, 2024 19:19
Install mysql2 on MacOS Mojave

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@ndbroadbent
ndbroadbent / .dev.scpt
Last active September 22, 2022 11:46
Using AppleScript to set up iTerm2 tabs and panes for Rails development
# iTerm2 AppleScript Docs: https://www.iterm2.com/documentation-scripting.html
on run argv
set current_dir to item 1 of argv
tell application "iTerm2"
tell current window
set rails_session to current session
set current_tab to current tab
tell current session
@zkochan
zkochan / .md
Last active November 15, 2021 14:43
filtering in pnpm vs lerna
Lerna v3.2 pnpm v2.15
--scope my-component -- my-component
--scope toolbar-* -- toolbar-*
--scope my-component --include-filtered-dependencies -- my-component...
--scope my-component --include-filtered-dependents -- ...my-component
@nickcernis
nickcernis / readme.md
Last active March 7, 2024 01:43
Exclude node_modules and .git from Backblaze backups on Mac

Exclude node_modules and .git from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add these rules inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@jbfriedrich
jbfriedrich / nsmb.conf
Last active April 25, 2024 14:58
macOS 11.2 NSMB configuration
# /etc/nsmb.conf - macOS 11.3 - 2021-04-29
#------------------------------------------------------------------------------
# SMB configuration for macOS 11.3 <-> Synology
#------------------------------------------------------------------------------
# Additional information:
# -----------------------
# https://support.apple.com/de-de/HT211927
# https://support.apple.com/en-us/HT208209
# https://apple.stackexchange.com/questions/309016/smb-share-deadlocks-since-high-sierra
# https://photographylife.com/afp-vs-nfs-vs-smb-performance
@Swalloow
Swalloow / dynamo_delete_all.py
Created May 18, 2018 06:38
Boto3 DynamoDB delete all items
import boto3
dynamodb = boto3.resource('dynamodb', 'region-name')
table = dynamodb.Table('table-name')
scan = table.scan(
ProjectionExpression='#k',
ExpressionAttributeNames={
'#k': 'name'
}
@lucasbrigida
lucasbrigida / disable_intel_turbo_boost.md
Last active November 1, 2023 19:20
Disable Intel Turbo Boost

Prerequisites

  • Intel processor

Installing

sudo apt-get install msr-tools linux-cpupower lm-sensors
@bvaughn
bvaughn / updating-subscriptions-when-props-change-example.js
Last active March 27, 2022 09:29
Advanced example for manually updating subscriptions in response to props changes in an async-safe way
// This is an advanced example! It is not typically required for application code.
// If you are using a library like Redux or MobX, use the container component provided by that library.
// If you are authoring such a library, use the technique shown below.
// This example shows how to safely update subscriptions in response to props changes.
// In this case, it is important to wait until `componentDidUpdate` before removing a subscription.
// In the event that a render is cancelled before being committed, this will prevent us from unsubscribing prematurely.
// We also need to be careful about how we handle events that are dispatched in between
// `getDerivedStateFromProps` and `componentDidUpdate` so that we don't put stale values into the `state`.
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql