Skip to content

Instantly share code, notes, and snippets.

View JohannMG's full-sized avatar
🐺

Johann Garces JohannMG

🐺
View GitHub Profile
@Inndy
Inndy / RecordViewController.swift
Created April 30, 2017 06:26
iOS create overlay with UIWindow
import UIKit
class RecordViewController: UIViewController {
@IBAction func closeOverlay(_ sender: Any) {
self.view.window?.resignKey()
self.view.window?.isHidden = true
}
}
func encode<T>(var value: T) -> NSData {
return withUnsafePointer(&value) { p in
NSData(bytes: p, length: sizeofValue(value))
}
}
func decode<T>(data: NSData) -> T {
let pointer = UnsafeMutablePointer<T>.alloc(sizeof(T.Type))
data.getBytes(pointer)
@chaosmail
chaosmail / python-pid_controller
Last active September 26, 2022 13:13
Simple PID Controller
def pid_controller(y, yc, h=1, Ti=1, Td=1, Kp=1, u0=0, e0=0)
"""Calculate System Input using a PID Controller
Arguments:
y .. Measured Output of the System
yc .. Desired Output of the System
h .. Sampling Time
Kp .. Controller Gain Constant
Ti .. Controller Integration Constant
Td .. Controller Derivation Constant
@benjick
benjick / dogeipsum.php
Last active December 28, 2015 05:38
Doge Ipsum aka Lorem Doge by dumfan
<?php
/*
░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░
░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░
░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░
░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░
░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░
░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░
░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌░░
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR