Skip to content

Instantly share code, notes, and snippets.

View onriv's full-sized avatar
🎯
Focusing

onriv onriv

🎯
Focusing
View GitHub Profile
import Mathlib.Tactic
namespace Impl3
class AddSemigroup₃ (α : Type) extends Add α where
/-- Addition is associative -/
add_assoc₃ : ∀ a b c : α, a + b + c = a + (b + c)
-- Here to_additive is defined in Mathlib.Tactic
@[to_additive AddSemigroup₃]
@onriv
onriv / server.py
Created March 20, 2023 02:36 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@onriv
onriv / 24-bit-color.sh
Created February 13, 2023 03:22 — forked from lifepillar/24-bit-color.sh
Test 24 bit colors in terminals
#!/bin/bash
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
setBackgroundColor()
@onriv
onriv / adoptopenjdk-openj9.txt
Created January 10, 2023 05:50 — forked from javajack/adoptopenjdk-openj9.txt
AdoptOpenJdk OpenJ9 Ubuntu Installation
Import the official AdoptOpenJDK GPG key
Import the AdoptOpenJDK DEB repo using add-apt-repository
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt update
@onriv
onriv / reflect.py
Created March 2, 2022 06:22 — forked from huyng/reflect.py
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@onriv
onriv / README.md
Created October 1, 2021 04:33 — forked from davideicardi/README.md
Write and read Avro records from bytes array

Avro serialization

There are 4 possible serialization format when using avro:

PROJECT(sayo_cli C CXX)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
enable_testing()
set(CMAKE_CXX_STANDARD 17)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
FIND_PACKAGE(JsonCpp REQUIRED)

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

For 3170 build 2018.05.08

VERSION PLATFORM OFFSET ORIGINAL CRACKED
@onriv
onriv / 0_reuse_code.js
Created February 20, 2017 16:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@onriv
onriv / poker.ahk
Last active February 18, 2017 03:57
poker.ahk
; version 0.0.1
; author chen shanghe
;
; this script is used for simulation the poker keyboard
; use capslock as fn
*Capslock::
caps := "on"
KeyWait, Capslock ; wait until the Capslock button is released
caps := ""