Skip to content

Instantly share code, notes, and snippets.

View d11z's full-sized avatar
:octocat:
Learning

d11z d11z

:octocat:
Learning
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active June 15, 2024 14:00
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@romanhaa
romanhaa / run.sh
Last active June 14, 2024 12:43
macOS settings
# https://macos-defaults.com/
# https://www.defaults-write.com
# reset with: defaults delete -g <FEATURE>
# dock
# position
defaults write com.apple.dock "orientation" -string "right"
# icon size
defaults write com.apple.dock "tilesize" -int "36"
@VonHeikemen
VonHeikemen / better-netrw.vim
Last active May 19, 2024 20:13
Making a more intuitive netrw
" Open Netrw on the directory of the current file
nnoremap <leader>dd :Lexplore %:p:h<CR>
" Toggle the Netrw window
nnoremap <Leader>da :Lexplore<CR>
if &columns < 90
" If the screen is small, occupy half
let g:netrw_winsize = 50
else
@leosvelperez
leosvelperez / .gitconfig
Last active June 11, 2024 12:36
Useful Git aliases
[alias]
a = add
ap = add -p
bd = branch -D
# Removes branches already merged
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"
c = commit
cm = commit -m
co = checkout
cob = checkout -b
@ld100
ld100 / ArchLinuxWSL2.md
Last active June 12, 2024 16:25
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@tigt
tigt / git-branch-to-favicon.js
Created March 18, 2020 21:10
Creates an SVG string that can be used as a favicon across different Git branches. Actually getting this into the browser is sadly project-specific.
const { execSync } = require('child_process')
const { createHash } = require('crypto')
const invertColor = require('invert-color')
const branchName = execSync('git rev-parse --abbrev-ref HEAD')
const hash = createHash('sha256')
hash.update(branchName)
const color = '#' + hash.digest().toString('hex').substring(0, 6)
const invertedColor = invertColor(color, true)
@darkliquid
darkliquid / !README.md
Last active May 23, 2024 04:55
Script for setting up my windows install. Run setup-windows.ps1

This is my desktop setup scripts for Windows. It installs a number of apps using scoops (in preference) and failing that, via chocolatey. It also makes a number of customisations and streamlining operations to Windows itself via registry changes and various powershell scripts, the most notable of which is the [Windows 10 Debloater][3] script.

After that, It sets up my [WSL][4] environment, and uses my [linux dotfiles repo][5] to customise that. The aim of this setup is to be a reasonably dev-friendly, secure windows environment with a ready-to-go linux environment setup via WSL. More customisations will be made as things like 'controlled folder access exceptions' and other things get discovered through usage.

@erineccleston
erineccleston / OrthographicOverride.cs
Last active August 7, 2019 21:45
Allows 2D Pixel Perfect to work with Cinemachine
using Cinemachine;
using UnityEngine;
using UnityEngine.U2D;
using System.Reflection;
/// <summary>
/// Add this component to a camera that has PixelPerfectCamera and CinemachineBrain
/// components to prevent the active CinemachineVirtualCamera from overwriting the
/// correct orthographic size as calculated by the PixelPerfectCamera.
/// </summary>
@fay59
fay59 / Quirks of C.md
Last active January 23, 2024 04:24
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@mrichman
mrichman / osx_bootstrap.sh
Last active May 7, 2024 10:58
Bootstrap script for setting up a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)