Skip to content

Instantly share code, notes, and snippets.

💭
😼

Lucas Garron lgarron

💭
😼
Block or report user

Report or block lgarron

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ole
ole / Mojave-dynamic-wallpaper-notes.md
Last active Jun 8, 2019
Reverse-engineering the dynamic wallpaper file format in macOS Mojave.
View Mojave-dynamic-wallpaper-notes.md

The dynamic wallpaper in MacOS Mojave is a single 114 MB .heic file that seems to contain 16 embedded images.

It also contains the following binary plist data in its metadata under the key "Solar". It's an array of 16 items, each with four keys:

  • i (integer). This seems to be the image index.
  • o (integer). This is always 1 or 0. Stephen Radford thinks it indicates dark mode (0) vs. light mode (1).
  • a (decimal). I’m pretty sure this is the angle of the sun over the horizon. 0º = sunset/sunrise. 90º = sun directly overhead. Negative values = sun below horizon.
  • z (decimal). This seems to be the cardinal position of the sun relative to the camera. 0º = sun is directly in front of the camera. 90º = sun is directly to the right of the camera. 180º = sun is directly behind the camera.
@mnot
mnot / snowden-ietf93.md
Last active Dec 21, 2018
Transcript of Edward Snowden's comments at IETF93.
View snowden-ietf93.md
@pochmann
pochmann / 3x3x3_simulator.py
Last active Aug 29, 2015
Check whether two 3x3x3 algorithms are equivalent by simulating their effects and comparing the results. I love this way to simulate these puzzles, no complicated data structures needed.
View 3x3x3_simulator.py
def sim(alg):
state = "UF UR UB UL DF DR DB DL FR FL BR BL UFR URB UBL ULF DRF DFL DLB DBR".split()
for move in alg.split():
perm = "FLBR FRBL FDBU FUBD URDL ULDR".split()['UDLRFB'.index(move[0])]
n = 2 + "2'".find(move[-1])
table = str.maketrans(perm, perm[n:] + perm[:n])
state = [p.translate(table) if move[0] in p else p for p in state]
return state
print(sim("D L2 B2 L2 R2 F2 R2 U2 R2 D' U' R' B F L' D R2") == sim("U R B F L D R2"))
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active Oct 15, 2019
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active Oct 15, 2019
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jussi-kalliokoski
jussi-kalliokoski / silence.js
Created Oct 6, 2011
Methods for creating an audio tag filled with a specified time of silence.
View silence.js
(function(g){
var urlPath =
window.URL ? 'URL' :
window.webkitURL ? 'webkitURL' :
window.mozURL ? 'mozURL' :
window.msURL ? 'msURL' :
window.oURL ? 'oURL' : '';
var blobPath =
@mathiasbynens
mathiasbynens / appify
Created Nov 12, 2010 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
View appify
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
You can’t perform that action at this time.