Skip to content

Instantly share code, notes, and snippets.

@tomysmile
tomysmile / mac-setup-redis.md
Last active May 5, 2025 13:06
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@smarkwell
smarkwell / json.ps1
Last active December 12, 2023 22:45
Loading large JSON data files into Powershell
# Work around on
# ConvertFrom-Json : Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.
$json = New-Object -TypeName System.Web.Script.Serialization.JavaScriptSerializer
$json.MaxJsonLength = 104857600 #100mb as bytes, default is 2mb
$filedata = [System.IO.File]::ReadAllText($JSONDataFile) #Using default encoding
$data = $json.DeserializeObject($filedata, [System.Object])
$filedata = $null
$json = $null
@consti
consti / hosts
Last active May 14, 2025 15:51
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost