This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"ns": "yt", | |
"el": "detailpage", | |
"cpn": "5h4OmoNG1Ceh6QJo", | |
"docid": "7GCb0lldiiM", | |
"ver": 2, | |
"referrer": "https://www.youtube.com/watch?v=PQjt6vLd2qA", | |
"cmt": "234.956", | |
"plid": "AAVTW6FegC7Z_Zfh", | |
"ei": "uVlZWYeWLsiXcK31ktgL", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-Frame-Options" content="deny"> | |
<title>▅▆▇▆▅▄▃ `^^^^^~ ░ ui▀┳╲ ☺ .info ▓</title> | |
<meta name="Keywords" content="keywords, keys, words, wordkeys"> | |
<link rel="shortcut icon" href="favicon.ico"> | |
<link href="assets/layout.css" rel="stylesheet" type="text/css"> | |
<link href="assets/styles.php" rel="stylesheet" type="text/css"> | |
<script type="text/javascript" async="" defer="" src="//piwik.michaelguidetti.info/piwik.js"></script><script type="text/javascript" src="assets/scripts.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import plistlib | |
def get_bundle_identifier(): | |
plist = plistlib.readPlist(os.path.abspath(os.path.join(sys.executable, '..', 'Info.plist'))) | |
return '{CFBundleIdentifier}'.format(**plist) | |
def is_pythonista_3(): | |
return get_bundle_identifier() == 'com.omz-software.Pythonista3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Copyright (c) 2016 Lukas Kollmer<lukas@kollmer.me> | |
from ctypes import * | |
from objc_util import ObjCClass | |
NSProcessInfo = ObjCClass('NSProcessInfo') | |
NSByteCountFormatter = ObjCClass('NSByteCountFormatter') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func privateHelperFunctionThatMayOrMayNotBeSemanticallyEquivalentToTheForceUnwrapOperator<T>(_ arg: T?) -> T { | |
let oof = { fatalError("OH MY GOD it was null all along") } | |
if MemoryLayout<T?>.size == MemoryLayout<T>.size { // zero abstraction optional? | |
if withUnsafeBytes(of: arg, { $0.allSatisfy { $0 == 0 } }) { | |
oof() | |
} | |
return unsafeBitCast(arg, to: T.self) | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// run w/ `CXX -DX=VAL`, where VAL is the input value | |
// https://godbolt.org/z/KgRth3 | |
template <int N> | |
struct Fib { | |
enum { | |
value = Fib<N-1>::value + Fib<N-2>::value | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tracking cursor position in real-time without JavaScript | |
// Demo: https://twitter.com/davywtf/status/1124146339259002881 | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fib: | |
(__TEXT,__text) section | |
_main: | |
0000000100000f30 pushq %rax | |
0000000100000f31 movq 0x8(%rsi), %rdi | |
0000000100000f35 callq 0x100000f88 ## symbol stub for: _atoi | |
0000000100000f3a movl %eax, %edi | |
0000000100000f3c callq __F3fibii | |
0000000100000f41 movl %eax, 0x4(%rsp) | |
0000000100000f45 movl 0x4(%rsp), %eax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ModuleID = 'main' | |
source_filename = "main" | |
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-apple-darwin18.5.0" | |
declare i32 @atoi(i8*) | |
define i32 @main(i32 %argc, i8** %argv) { | |
entry: | |
%0 = alloca i32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fib_it = n => { | |
let [a, b] = [0, 1]; | |
while (n-- > 0) { | |
[a, b] = [b, a + b]; | |
} | |
return a; | |
} | |
const fib_rec = n => { | |
if (n < 2) return n; |
NewerOlder