Skip to content

Instantly share code, notes, and snippets.

@ClaireNeveu
ClaireNeveu / poc.patch
Created April 16, 2024 14:35
anyrun poc
diff --git a/anyrun/src/main.rs b/anyrun/src/main.rs
index fb9f62e..d4594da 100644
--- a/anyrun/src/main.rs
+++ b/anyrun/src/main.rs
@@ -294,9 +294,21 @@ fn main() {
}
fn activate(app: &gtk::Application, runtime_data: Rc<RefCell<RuntimeData>>) {
+ let monitor = gdk::Screen::default()
+ .expect("Failed to get GDK screen for CSS provider!");
@ClaireNeveu
ClaireNeveu / example-data.json
Created February 17, 2023 18:38
Git Explorer Sample Data
{
"repos": {
"determined-ai/determined": {
"id": 253846879,
"node_id": "MDEwOlJlcG9zaXRvcnkyNTM4NDY4Nzk=",
"name": "determined",
"full_name": "determined-ai/determined",
"private": false,
"owner": {
"login": "determined-ai",
@ClaireNeveu
ClaireNeveu / useSettings.ts
Last active October 6, 2022 21:03
useSettings Skeleton
import { createContext, ReactChildren, useContext, useEffect, useMemo, useState } from 'react';
import { Type } from 'io-ts';
import { useNavigate } from 'react-router-dom-v5-compat';
/*
* UserSettingsTable contains all the settings for a user
* across the application. Each key identifies a unique part
* of the interface to store settings for.
*/
@ClaireNeveu
ClaireNeveu / ads.js
Last active November 3, 2020 17:51
ublock userResource
/// twitch-videoad.js
const origFetch = window.fetch;
window.fetch = (url, init, ...args) => {
if (typeof url === "string") {
if (url.includes("/access_token")) {
url = url.replace("player_type=site", "player_type=thunderdome");
} else if (
url.includes("/gql") &&
init &&
typeof init.body === "string" &&
// BEGIN Other type defs
type User = {
name: string
}
type Organization = {
name: string,
active: boolean
}
// END Other type defs
@ClaireNeveu
ClaireNeveu / crawler.py
Created November 9, 2017 20:32
Phone Number Crawler
from multiprocessing import Pool, Queue
import argparse
from queue import Queue
import sqlite3
import re
from urllib.parse import urljoin, urlparse
import functools
from bs4 import BeautifulSoup
import requests
@ClaireNeveu
ClaireNeveu / NonEmptyString.scala
Last active April 11, 2017 01:22
NonEmptyString
package nonemptystring
import macrame.delegate
import scala.collection.immutable.StringOps
final case class NonEmptyString(val head : Char, val tail : String) {
@delegate
override def toString : String = head + tail
}
#! /usr/bin/env python3
import sys
import time
def main():
spinner = Spinner()
for x in range(20):
time.sleep(0.2)
@ClaireNeveu
ClaireNeveu / third-party-viddler-videos.csv
Created July 26, 2016 18:33
Third-party Viddler Videos
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
9ab3716
explore
c4a8e90c
8baef12e
e5b3acca
2b2450d4
dec1c552
2382
1155e288
2067
@ClaireNeveu
ClaireNeveu / monad.ml
Last active July 24, 2016 23:04
Defining Categories with Structural Types
type 'a monad = { bind : 'b. ('a -> 'b monad) -> 'b monad }
type 'a option = { getOrElse : 'a -> 'a }
let none = { getOrElse = (fun b -> b); bind = fun f -> none};;
let some a = { getOrElse = (fun b -> a); bind = fun f -> f a};;