Skip to content

Instantly share code, notes, and snippets.

View tyler569's full-sized avatar

Tyler Philbrick tyler569

  • San Francisco, USA
View GitHub Profile
$ echo foo bar | rot13
Thread: [4:4] ("echo") performed an access violation
Fault reading data:0xd8 because page not present from kernel mode.
NULL pointer access?
Fault occured at 0xffffffff8010c82a
rax: 4 r8 : 20
rbx: ffffffff8012be70 r9 : 0
rcx: 4 r10: ffffffff8010dbc2
rdx: 4 r11: 0
rsp: ffffffffc009ddf8 r12: 4
hermes::ng-toolchain-build => diff -r ng-gcc-9.2.0/ base-gcc-9.2.0/
diff -r ng-gcc-9.2.0/config.sub base-gcc-9.2.0/config.sub
1366,1367c1366
< | midnightbsd* | amdhsa* | unleashed* | emscripten* \
< | nightingale*)
---
> | midnightbsd* | amdhsa* | unleashed* | emscripten*)
diff -r ng-gcc-9.2.0/fixincludes/mkfixinc.sh base-gcc-9.2.0/fixincludes/mkfixinc.sh
14d13
< *-nightingale* | \
import java.util.function.*;
interface Monad<T> {
Monad<T> bind(Function<T, Monad<T>> fn);
}
class maybe<T> implements Monad<T> {
boolean valid;
T value;
tyler@xps:~/lcc$ python3 parse_test.py
>
> 2+2
[2, '+', 2]
('+', 2, 2)
4
> 2*2+2
[2, '*', 2, '+', 2]
('+', ('*', 2, 2), 2)
6
OLD:
Hello World from ring 3!
Nightingale shell
$ bomb
Fault was caused by writing to a reserved field
Fault writing data:0xffff80c040000010 because protection violation from kernel mode.
Fault occured at 0xffffffff8010b5db
rax: ffff80c040000010 r8 : 0
rbx: 5 r9 : 0
@tyler569
tyler569 / Quirks of C.md
Created September 10, 2018 19:27 — forked from fay59/Quirks of C.md
Quirks of C

Here's a list of mildly interesting things about the C language that I learned over time. There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
       int x;
   } baz;
};
module Fibonizzbuzz where
fib' :: (Ord a, Num a) => a -> a -> a -> a
fib' a b cnt
| cnt < 0 = a
| otherwise = fib' b (a+b) (cnt-1)
fib :: (Ord a, Num a) => a -> a
fib x = fib' 1 1 x
@tyler569
tyler569 / mandelbrot.html
Created October 14, 2017 18:24
WebGL mandelbrot
<!doctype html>
<html>
<head>
<title>Test webgl!</title>
<script type='x-shader/x-vertex' id='vert-shader'>
attribute vec2 coordinates;
void main(void) {
fs = require('fs')
png = require('pngjs')
math = require('mathjs')
size = 800
size2 = size / 2
image = new png.PNG({width: size, height: size})
char[] command(char[] ircMessage) {
// import std.algorithm;
import std.string;
if (ircMessage.length == 0) {
/* throw ? */
return [];
}