Skip to content

Instantly share code, notes, and snippets.

View TheNorthEestern's full-sized avatar

Kacy James TheNorthEestern

View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active May 18, 2024 17:55
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:

@u-ndefine
u-ndefine / 50_lines.pde
Last active April 25, 2024 12:07
Sketch of my generative art, "50 Lines"
float decel(float x) { // as an easing function
return 1-(x-1)*(x-1);
}
void setup() {
background(255);
size(750,750,P2D);
PImage img = loadImage("image.png");
strokeWeight(2);
noFill();
@darkguy2008
darkguy2008 / UDPSocket.cs
Last active April 21, 2024 14:48
Simple C# UDP server/client in 56 lines
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
namespace UDP
{
public class UDPSocket
{
private Socket _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
@matthewreagan
matthewreagan / Perlin
Last active March 30, 2024 16:18
Perlin noise generation in Swift
// Perlin.swift
// Created by Matthew Reagan on 8/7/18.
//
// Quick implementation of the the classic Perlin noise
// generation function, useful for creating organic textures
// or terrain. Perlin noise can also be easily generated with
// Apple's GameplayKit framework, this code is mostly for
// experimentation purposes. (Disclaimer: This code is not
// optimized, nor particularly elegant, but it can be used as
// a jumping off point for writing custom noise functions.)
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@bened-h
bened-h / blender_game_of_life.py
Last active November 20, 2023 19:10
This script implements Convey's "Game of Life" in Blender 2.8.
# blender 2.8
"""
This script implements Convey's "Game of Life" in Blender 2.8
It relies on the blender file containing a mesh called "Cube"
(sidelength = 1) and an empty collection called "Grid".
"""
import bpy
from random import random
@mbostock
mbostock / .block
Last active May 19, 2023 19:28
Polar Clock III
license: gpl-3.0
height: 960
@jlnquere
jlnquere / UICollectionViewScroll.swift
Last active June 10, 2022 14:25
XCUITests: scroll UICollectionView to find one of it's offscreen UICollectionViewCell by id
// Thanks to @MonsieurDart for the idea :)
func scroll(collectionView:XCUIElement, toFindCellWithId identifier:String) -> XCUIElement? {
guard collectionView.elementType == .collectionView else {
fatalError("XCUIElement is not a collectionView.")
}
var reachedTheEnd = false
var allVisibleElements = [String]()
while !reachedTheEnd {
@ikhvorost
ikhvorost / LocalNetworkPrivacy.swift
Last active December 1, 2021 01:36
Checking Local Network Privacy access state for iOS 14
//
// LocalNetworkPrivacy
//
// Created by Iurii Khvorost <iurii.khvorost@gmail.com> on 2021/02/04.
// Copyright © 2021 Iurii Khvorost. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@bencbartlett
bencbartlett / pulse.nb
Created October 6, 2019 21:34
Mathematica code for photon pulse animation
<< MaTeX`
SetOptions[MaTeX, "Preamble" -> {"\\usepackage{color,txfonts}"}];
SetDirectory[NotebookDirectory[]];
c = 1;
\[Alpha] = .7;
\[Beta] = .05;
k0 = 7;
\[Omega]0 = 2 c;
vg = c;