Skip to content

Instantly share code, notes, and snippets.

@jeregrine
jeregrine / exwx.exs
Created October 13, 2023 22:20 — forked from rlipscombe/exwx.exs
Using wxWidgets from Elixir
#!/usr/bin/env elixir
defmodule Canvas do
@behaviour :wx_object
@title "Canvas Example"
@size {600, 600}
def start_link() do
:wx_object.start_link(__MODULE__, [], [])

Xmerl

Mix.install([
  {:tesla, "~> 1.7"},
  {:fast_xml, "~> 1.1"}
])

Data

@jeregrine
jeregrine / elixir_nsid.ex
Created May 3, 2023 20:33
Elixir NSID Parser and Validator
defmodule NSID do
@moduledoc """
Grammar:
alpha = "a" / "b" / "c" / "d" / "e" / "f" / "g" / "h" / "i" / "j" / "k" / "l" / "m" / "n" / "o" / "p" / "q" / "r" / "s" / "t" / "u" / "v" / "w" / "x" / "y" / "z" / "A" / "B" / "C" / "D" / "E" / "F" / "G" / "H" / "I" / "J" / "K" / "L" / "M" / "N" / "O" / "P" / "Q" / "R" / "S" / "T" / "U" / "V" / "W" / "X" / "Y" / "Z"
number = "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" / "0"
delim = "."
segment = alpha *( alpha / number / "-" )
authority = segment *( delim segment )
name = segment
nsid = authority delim name

What is a Tensor

Mix.install([
  {:nx, "~> 0.5.3"}
])

Section

@jeregrine
jeregrine / canvas.livemd
Last active December 9, 2021 23:02
LiveBook Canvas Example. You will need to run this locally and apply a patch to make it possible.

Canvas Example

Setup

First clone livebook and apply the following diff (time of writing commit 973fc51c9d5cdcc8863016de0cf9127add0a90fb)

diff --git a/assets/js/app.js b/assets/js/app.js
@jeregrine
jeregrine / fakespot.js
Last active September 21, 2024 15:28
Fakespot Amazon Grease Monkey
// ==UserScript==
// @name FakeSpot Amazon
// @version 1
// @match https://*.amazon.com/gp/product/*
// ==/UserScript==
const url = "https://www.fakespot.com/analyze?url="+ encodeURIComponent(window.location)
window.addEventListener('load', () => {
let ratings = document.getElementById("averageCustomerReviews_feature_div");
@jeregrine
jeregrine / hiring.md
Last active November 19, 2018 19:08
RokkinCat is Hiring

Date Posted: 11/19/2018

Full Time Web Developer

Description: Developer who is familar with front end web development technologies, including but not limited to:

  • JavaScript
  • HTML/CSS
  • Comfortable with at least one major modern JavaScript framework and comfortable moving frameworks as client needs change.

The ideal candidate is someone who is:

@jeregrine
jeregrine / wine.rb
Last active June 27, 2016 23:10 — forked from searls/wine.rb
Install wine via homebrew with directx patch for Stardew Valley
# NOTE: When updating Wine, please check Wine-Gecko and Wine-Mono for updates
# too:
# - http://wiki.winehq.org/Gecko
# - http://wiki.winehq.org/Mono
class Wine < Formula
desc "Wine Is Not an Emulator"
homepage "https://www.winehq.org/"
head "git://source.winehq.org/git/wine.git"
stable do
$ brew install cmake
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Downloading https://cmake.org/files/v3.5/cmake-3.5.2.tar.gz
Already downloaded: /Users/jasonstiebs/Library/Caches/Homebrew/cmake-3.5.2.tar.gz
==> ./bootstrap --prefix=/usr/local/Cellar/cmake/3.5.2 --no-system-libs --parallel=4 --datadir=/share/cmake --docdir=/share/doc/cmake --mandir=/share/man --sys
Last 15 lines from /Users/jasonstiebs/Library/Logs/Homebrew/cmake/01.bootstrap:
### Keybase proof
I hereby claim:
* I am jeregrine on github.
* I am peregrine (https://keybase.io/peregrine) on keybase.
* I have a public key ASCxv5_catIscgkxbyUrDSk52s9QabLO7S4Yhe2Qqs_eYQo
To claim this, I am signing this object: