Skip to content

Instantly share code, notes, and snippets.

View bjonnh's full-sized avatar
🐈

Jonathan Bisson bjonnh

🐈
View GitHub Profile
module top
(
input clk_25mhz,
output [27:0] gp,
);
wire [3:0] clocks;
wire [3:0] clocks2;
ecp5pll
module I2SInterface(
input sclk, // 25 MHz System clock
input bclk, // 6.25 MHz Bit Clock
input lr, // Left/Right Channel Select
input linData, // Line In Data
output loutData, // Line Out Data
input [23:0] inLeft, // left signal to line out
input [23:0] inRight, // right signal to line out
@bjonnh
bjonnh / results.txt
Created December 2, 2020 04:40
Results of Advent of code 2020 - Day 1
Benchmark Mode Cnt Score Error Units
Day1Bench.Dumb sample 1687 2.966 ± 0.006 ms/op
Day1Bench.Dumb:Dumb·p0.00 sample 2.925 ms/op
Day1Bench.Dumb:Dumb·p0.50 sample 2.953 ms/op
Day1Bench.Dumb:Dumb·p0.90 sample 2.990 ms/op
Day1Bench.Dumb:Dumb·p0.95 sample 3.015 ms/op
Day1Bench.Dumb:Dumb·p0.99 sample 3.191 ms/op
Day1Bench.Dumb:Dumb·p0.999 sample 4.326 ms/op
Day1Bench.Dumb:Dumb·p0.9999 sample 4.473 ms/op
Day1Bench.Dumb:Dumb·p1.00 sample 4.473 ms/op
@bjonnh
bjonnh / decode_outlook.el
Last active November 10, 2020 17:32
Decode outlook protection urls in elisp
(defun decode-url-at-point (&optional arg)
"Decode the outlook protection encoded url, display it as a message and put in the kill-ring."
(interactive "P")
(let ((url (browse-url-url-at-point)))
(if url
(let ((decodedurl (url-unhex-string (nth 1 (split-string (nth 0 (split-string url "&")) "=")))))
(message "%s" decodedurl)
(kill-new decodedurl))
(error "No URL found"))))
@bjonnh
bjonnh / decode_outlook.py
Created November 10, 2020 17:11
Decode outlook safe whatever urls
# Adapted from https://modernsecuritymethods.com/2019/10/04/url-decoding/
from urllib.parse import unquote
import re
import sys
def decode_url(url):
decoded_url = unquote(url.lower())
try:
final_url = ''
h = decoded_url.split('http')
@bjonnh
bjonnh / main.owl
Last active November 6, 2020 21:34
template.tsv robot template error with some
<?xml version="1.0"?>
<rdf:RDF xmlns="http://purl.obolibrary.org/obo/pho.owl#"
xml:base="http://purl.obolibrary.org/obo/pho.owl"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:eco="http://purl.obolibrary.org/obo/eco#"
xmlns:obo="http://purl.obolibrary.org/obo/"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
(defvar org-screenshot-process nil
"Currently running screenshot process")
;; Because cl is deprecated
(defun plusp (arg)
(if (> arg 0) true nil )
)
(defun org-screenshot-take (&optional delay)
"Take a screenshot and insert link to it at point, if image
display is already on (see \\[org-toggle-inline-images])
screenshot will be displayed as an image
@bjonnh
bjonnh / Redirector.json
Last active April 9, 2024 07:49
A redirector configuration file that allows to get direct access to PDFs for Wiley's publications. (this will not bypass the paywall)
{
"createdBy": "Redirector v3.5.3",
"createdAt": "2020-07-07T19:44:24.659Z",
"redirects": [
{
"description": "Wiley pdf",
"exampleUrl": "https://onlinelibrary.wiley.com/doi/epdf/10.1002/mrc.4283",
"exampleResult": "https://onlinelibrary.wiley.com/doi/pdfdirect/10.1002/mrc.4283",
"error": null,
"includePattern": "(https://onlinelibrary[\\-\\.]wiley[\\-\\.]com[a-z\\-\\.]*)/doi/epdf/(.*)",
;;; lsp-sparql.el --- lsp-sparql config -*- lexical-binding: t; -*-
;; Copyright (C) 2020 lsp-mode developers
;; Author: Jonathan Bisson <research@bjonnh.net>
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@bjonnh
bjonnh / fuzzy_arrays.py
Last active April 4, 2020 21:57
Python fuzzy arrays
import random
import math
class FuzzyArray:
def __init__(self, *content):
self.content = content
def __getitem__(self, index):
low_index = math.floor(index)
high_index = math.ceil(index)
if (high_index>=len(self.content)):