Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
# 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" |
" 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 |
[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 |
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.
wsl --set-default-version 2
in windows command line, so that all future WSL machine will use WSL2.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) |
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.
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> |
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.
struct foo {
struct bar {
int x;
#!/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) |