Skip to content

Instantly share code, notes, and snippets.

View cogumbreiro's full-sized avatar

Tiago Cogumbreiro cogumbreiro

View GitHub Profile
@cogumbreiro
cogumbreiro / 99-asus-falchion.hwdb
Created January 11, 2022 22:33 — forked from jnettlet/99-asus-falchion.hwdb
Stop Asus ROG Falchion mechanical keyboard from sending POWER and SLEEP key presses when the keyboard goes to sleep. Put in /etc/udev/hwdb.d and then run sudo systemd-hwdb update
evdev:input:b*v0B05p193Ee0111*
KEYBOARD_KEY_10081=reserved
KEYBOARD_KEY_10082=reserved
@cogumbreiro
cogumbreiro / nat-examples.v
Created November 18, 2019 01:27
Two trivial facts on natural numbers in Coq.
Goal 1 > 0.
apply le_n.
Qed.
Goal forall n, S n > 0.
(* What is gt? *)
Print gt.
(*
gt = fun n m : nat => m < n
: nat -> nat -> Prop
name: Example 4
source code: |
input: '0011'
blank: ' '
start state: S
table:
S:
0: {R: accept}
name: Even length
source code: |
input: '0111'
blank: ' '
start state: A
table:
A:
[0,1]: {R: B}
name: Example 3
source code: |
input: 'aabbcc'
blank: ' '
start state: S
table:
S:
'x': {R: S}
name: Example 2
source code: |
input: '0011'
blank: ' '
start state: S
table:
S:
0: {write: 'x', R: B}
name: Example 1
source code: |
input: '01110'
blank: ' '
start state: S
table:
S:
0: {write: 'x', R: B}
@cogumbreiro
cogumbreiro / url-unmangler.user.js
Last active August 21, 2019 18:37 — forked from bbqsrc/google-unmangler.user.js
Outlook / Google Search Unmangler - Greasemonkey Script
// ==UserScript==
// @name Google Search / Outlook /Gmail Unmangler
// @namespace URLUnmangle
// @description Gmail / Google Search URLs
// @include http://google.tld/*
// @include http://www.google.tld/*
// @include https://mail.google.tld/*
// ==/UserScript==
var URLUnmangle = {};
@cogumbreiro
cogumbreiro / Main.purs
Last active November 11, 2016 21:16
Known-set implementation in PureScript
module Main where
import Prelude
import Data.Set as S
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Data.Set (Set, empty)
type Task = Int
type Spawns = Set Task
@cogumbreiro
cogumbreiro / PrintMemoryUsage.java
Created October 14, 2016 23:40
Sample Java's memory usage.
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
public class PrintMemoryUsage implements Runnable {
private final Logger log = Logger.getLogger("GORN");
private final Level level;