Skip to content

Instantly share code, notes, and snippets.

View izhangzhihao's full-sized avatar

Zhihao Zhang izhangzhihao

View GitHub Profile
@izhangzhihao
izhangzhihao / README.md
Created September 28, 2023 07:51
Remove a non-removable Simple MDM profile from macOS without a complete wipe

https://graffino.com/til/UmkCdmEx7v-remove-a-non-removable-mdm-profile-from-macos-without-a-complete-wipe

Non-removable MDM profiles cannot officially removed without doing a full system wipe. This is a problem when you restore a system from Time Machine after you enrolled it into the MDM, as the MDM will break, leaving you unable to re-enroll the machine.

Here's how to remove a non-removable MDM profile Boot the Mac into Recovery Mode (hold down command+R during startup). Go to the Utilities menu and open Terminal and type: csrutil disable. This will disable SIP (System Integrity Protection). Reboot into the OS. Open the integrated terminal and type:

@izhangzhihao
izhangzhihao / pr.md
Created June 18, 2022 12:29 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Haskeller Competency Matrix

See also List of materials about Software Design in Haskell

Junior Middle Senior Architect
Haskell level Basic Haskell Intermediate Haskell Advanced Haskell Language-agnostic
Haskell knowledge scope Learn you a Haskell Get programming with Haskell Haskell in Depth Knows several languages from different categories
Get programming with Haskell Haskell in Depth Functional Design and Architecture
[Other books on Software Architecture in Haskell](https://github.com/graninas/software-design-in-haskell#Books-on-S
@izhangzhihao
izhangzhihao / Lazy.ts
Last active June 5, 2020 06:46
Lazy implementation in typescript
export class Lazy<T> {
private instance: T | undefined = undefined;
private readonly initializer: () => T;
constructor(initializer: () => T) {
this.initializer = initializer;
}
public get value(): T {
if (this.instance === undefined) {
@izhangzhihao
izhangzhihao / tflite_runtime-2.1.0.post1-cp37-cp37m-linux_x86_64.whl
Last active April 2, 2020 08:31
TensorFlow Lite build against with GLIBC_2.17
@izhangzhihao
izhangzhihao / Option.java
Created May 25, 2018 07:17
Optional of throwable
import java.util.Optional;
import java.util.function.Function;
public class Option {
public static <T, V> Optional<V> ofThrowable(T it, Function<T, V> func) {
try {
return Optional.ofNullable(func.apply(it));
} catch (Exception e) {
return Optional.empty();
}
@izhangzhihao
izhangzhihao / gadt.md
Created May 21, 2018 16:23 — forked from smarter/gadt.md
GADTs in Scala

Generalized Algebraic Data Types in Scala

Basic GADTs

Here's an ADT which is not a GADT, in Haskell:

data Expr = IntExpr Int | BoolExpr Bool
<application>
<component name="RainbowSettings">
<option name="rainbowifyHTMLInsideJS" value="true" />
<option name="version" value="5.1" />
<option name="lightRoundBracketsColors">
<array>
<option value="0x263238" />
<option value="0x455a64" />
<option value="0x607d8b" />
<option value="0x90a4ae" />
@izhangzhihao
izhangzhihao / url_decode.rb
Created February 3, 2018 14:19
Url decode in jekyll
# _plugins/url_decode.rb
require 'liquid'
require 'uri'
module URLDecode
def url_decode(url)
return URI.decode(url)
end
end
@izhangzhihao
izhangzhihao / Using.scala
Created January 28, 2018 08:29
Using.scala
def using[C, T](resource: C)(handle: C => T)(implicit env: C => ({def close(): Unit})): T = {
try {
handle(resource)
} finally {
resource.close()
}
}