Skip to content

Instantly share code, notes, and snippets.

View unixb0y's full-sized avatar
👨‍💻
Hacking

Dave unixb0y

👨‍💻
Hacking
  • Planet Earth
View GitHub Profile
@unixb0y
unixb0y / rm-storyboard.sh
Last active June 19, 2020 23:40
Easily remove storyboard of a fresh Xcode 11.3.1+ project and do all your layout in code.
if [ $# -eq 0 ]
then echo 'No project name supplied'; exit 0
fi
# 1) Add necessary Code to SceneDelegate
a='guard let _ = (scene as? UIWindowScene) else { return }'
b='guard let windowScene = (scene as? UIWindowScene) else { return }\
window = UIWindow()\
@unixb0y
unixb0y / TextViewAlertController.swift
Last active November 26, 2021 05:49
Drop-in UIAlertController replacement with embedded UITextView
//
// TextViewAlertController.swift
// TextViewAlertController
//
// Created by Davide Toldo on 01.11.19.
// Copyright © 2019 Davide Toldo. All rights reserved.
//
import UIKit
class TextViewAlertController: UIAlertController {
@unixb0y
unixb0y / UIImage+Orientation.swift
Created March 4, 2019 02:26 — forked from nRewik/UIImage+Orientation.swift
UIImage fix orientation ( rotate pixel rather than relying on exif ) -- Swift 4, no force unwraps
import UIKit
extension UIImage {
func fixOrientation() -> UIImage {
guard let cg = cgImage, let cg_colorspace = cg.colorSpace else {
print("Error while fixing image orientation")
return self
}
@unixb0y
unixb0y / python-cc1101-ook.py
Created December 13, 2018 00:37
CC1101 OOK receiver
from digitalio import DigitalInOut
import board
import busio
from adafruit_bus_device.spi_device import SPIDevice
WRITE_SINGLE_BYTE = 0x00
WRITE_BURST = 0x40
READ_SINGLE_BYTE = 0x80
READ_BURST = 0xC0
@unixb0y
unixb0y / hosts
Created April 25, 2018 13:00
hosts file for blocking basically all Google connections
##
# Put this AFTER your current
# /etc/hosts file contents!
# After that, either reboot or
# manually flush your DNS cache
##
127.0.0.1 google.com #} redirects to us2.startpage.com:443
127.0.0.1 www.google.com #} 216.218.239.164 is the IP address for the
127.0.0.1 google.ca #} Google frontend Startpage and automatically
@unixb0y
unixb0y / alu.sv
Created February 19, 2018 15:53
ALU start
module alu(input logic [31:0] A, B, input logic [2:0] OPC, output logic [31:0] Y);
logic [31:0] temp;
Shifter shift(.A(A), .B(B), .Y(temp));
always_comb
case(OPC)
0: Y = temp;
default: Y = 32'd0;
endcase
endmodule

Keybase proof

I hereby claim:

  • I am unixb0y on github.
  • I am unixb0y (https://keybase.io/unixb0y) on keybase.
  • I have a public key ASBN2djOYq0c43vlpSKLNT0ikehVTJox-6F0SxepG9H7Bwo

To claim this, I am signing this object:

@unixb0y
unixb0y / RBResizer.swift
Created April 14, 2017 15:21 — forked from licvido/RBResizer.swift
SWIFT: Crop image to square (& resize)
//
// RBResizer.swift
// Locker
//
// Created by Hampton Catlin on 6/20/14.
// Copyright (c) 2014 rarebit. All rights reserved.
//
import UIKit

Keybase proof

I hereby claim:

  • I am unixb0y on github.
  • I am unixb0y (https://keybase.io/unixb0y) on keybase.
  • I have a public key whose fingerprint is A5B3 D67E 57E1 C1DB CB80 DBA0 6481 86D0 D05B 04D6

To claim this, I am signing this object: