Skip to content

Instantly share code, notes, and snippets.

@benkulbertis
benkulbertis / cloudflare-update-record.sh
Last active May 17, 2026 12:22
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="[email protected]"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active May 10, 2026 16:01
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@samrocketman
samrocketman / osx_wine_fallout3.md
Last active September 27, 2024 20:37
Fallout 3 Mac OS X on WINE. STALKER Call of Pripyat Mac OS X on WINE.

Windows-only games on Mac OS X

Achieved with WINE. None of the online tutorials were sufficient so I created this.

Games and settings

I've played the following Windows-only games with zero performance issues.

  • Fallout 3 GOTY Edition
  • S.T.A.L.K.E.R.: Call of Pripyat
@qwIvan
qwIvan / shadowiptables.sh
Last active February 28, 2023 22:57
自动翻墙脚本,配合shadowsocks-libev的ss-redir使用,需要ipset(sudo apt-get install ipset)
#!/bin/bash
#自动翻墙脚本,配合shadowsocks-libev的ss-redir使用。需要ipset
chnroute_file=~/.chnroute
ignore_ips=(
45.32.50.160
45.127.93.239
103.214.68.175
0.0.0.0/8
10.0.0.0/8
127.0.0.0/8
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
@tzmartin
tzmartin / ipsw.decrypt.md
Created January 12, 2016 17:55
Decrypting ipsw firmware files
@hujunfeng
hujunfeng / Root.plist
Last active November 21, 2024 21:35
Add version in Settings.bundle for iOS apps
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>DefaultValue</key>
<string></string>
<key>Key</key>
@kevinelliott
kevinelliott / 1-macOS-10.12-sierra-setup.md
Last active December 9, 2025 16:24
macOS 10.12 Sierra Setup

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@128keaton
128keaton / DestinationView.swift
Last active June 6, 2018 14:02
Dragging view in Swift 3
import Foundation
import Cocoa
class DestinationView: NSView {
var isHighlighed: Bool! = false
override func awakeFromNib() {
self.register(forDraggedTypes: [NSFilenamesPboardType])
}
func isHighlighted() -> Bool! {
@lattner
lattner / async_swift_proposal.md
Last active April 27, 2026 19:27 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.