Skip to content

Instantly share code, notes, and snippets.

View menangen's full-sized avatar
🏠
Working from home

Andru Menangen menangen

🏠
Working from home
  • Russia
View GitHub Profile
@startergo
startergo / Big Sur kext update.md
Created May 8, 2021 05:57
Big Sur kext update
  • Find your System volume:
diskutil list
/dev/disk5 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +255.7 GB   disk5
                                 Physical Store disk4s2
   1:                APFS Volume ⁨Big Sur HD - Data⁩       122.5 GB   disk5s1
   2:                APFS Volume ⁨Preboot⁩                 309.4 MB   disk5s2
 3: APFS Volume ⁨Recovery⁩ 887.8 MB disk5s3
@VAnsimov
VAnsimov / LifeCycleApp-Example1.swift
Last active November 6, 2020 11:29
Application life cycle
@main
struct YourApp: App {
var body: some Scene {
let publisherBackground = NotificationCenter.default.publisher(for: UIApplication.willResignActiveNotification)
let publisherForeground = NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)
return WindowGroup {
RootView()
.onReceive(publisherBackground) { _ in
@Kutkovsky
Kutkovsky / Catalina_ISO.sh
Created June 26, 2019 10:17
The steps allowing to create macOS 10.15 Catalina VM on vSphere or ESXi
#!/bin/bash
# Steps to create the macOS Catalina (10.15) VM:
# login to developer.apple.com or beta.apple.com to download a tester's profile for your OS. Install it.
# Go to System Preferences > Software Update and start the update process
# When the Catalina Installer (few MBytes) is started, it downloads the remain part of installation.
# After all `Install Catalina Beta.app` should lay in the /Applications folder with approx. 6.5g size
# Proceed with the following script.
set -eux
@SkrewEverything
SkrewEverything / TCPServer.c
Last active March 2, 2023 10:52
Simple TCP server
// Server side C program to demonstrate Socket programming
#include <stdio.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <string.h>
#define PORT 8080
int main(int argc, char const *argv[])
@mayoff
mayoff / minimal-metal.swift
Created December 23, 2017 06:43
Hello, Triangle! (MetalKit + Swift 4)
import Cocoa
import MetalKit
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, MTKViewDelegate {
weak var window: NSWindow!
weak var metalView: MTKView!
let device = MTLCreateSystemDefaultDevice()!
var commandQueue: MTLCommandQueue!
var pipelineState: MTLRenderPipelineState!
@ultrasilicon
ultrasilicon / uv_tcp_echo.c
Created December 7, 2017 16:45
libuv TCP echo server example
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <uv.h>
#define DEFAULT_PORT 7000
#define DEFAULT_BACKLOG 128
uv_loop_t *loop;
struct sockaddr_in addr;
@ibraheem4
ibraheem4 / postgres-brew.md
Last active May 1, 2024 09:43 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@teraPacket
teraPacket / tcp_client.c
Created August 16, 2017 03:43
example TCP client using libuv (version 1.0)
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>
//based on https://gist.githubusercontent.com/snatchev/5255976/
//raw/8392c42d719bb775053036e32b21affdf932c1b7/libuv-tcp-client.c
//which was based on libuv 0.1, there is considerable difference there.
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
@oznu
oznu / README.md
Last active November 22, 2023 19:49
QEMU + Ubuntu ARM aarch64

QEMU + Ubuntu ARM aarch64

These are the steps I used to get Ubuntu ARM aarch64 running with QEMU on OSX.

Get Ubuntu Image and QEMU EFI:

wget https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-arm64-uefi1.img
wget https://releases.linaro.org/components/kernel/uefi-linaro/latest/release/qemu64/QEMU_EFI.fd
@mdonkers
mdonkers / server.py
Last active April 30, 2024 23:26
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer