This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import gi | |
gi.require_version('Gtk', '3.0') | |
from gi.repository import Gtk | |
class Calculator: | |
def __init__ (self): | |
self.carry = 0 | |
self.ops = { | |
'=': (lambda x, y: self.carry), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Bump reminder | |
// @version 0.3 | |
// @match https://disboard.org/dashboard/servers | |
// ==/UserScript== | |
(function() { | |
setTimeout(() => { | |
const buttons = [...document.querySelectorAll("[data-origin-text='Bump']")]; | |
if (buttons.filter(b => b.innerText.toLowerCase() == "bump").length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.sortBy = (function() { | |
const sorters = { | |
string: (a, b) => a < b ? -1 : (a > b ? 1 : 0), | |
number: (a, b) => a - b, | |
}; | |
return function(prop) { | |
const type = typeof this[0][prop] || 'string'; | |
return this.sort((a, b) => sorters[type](a[prop], b[prop])); | |
}; | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Telegram Dark mode | |
// @version 0.2 | |
// @match https://web.telegram.org/* | |
// ==/UserScript== | |
setTimeout(() => { | |
var styles = [ | |
["body, .tg_head_split, .im_page_wrap, .im_dialogs_search_field, .im_record_bg", | |
[["backgroundColor", "#000"], ["color", "#fff"]]], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Longest file name | |
find . -name '*.cs' | awk 'function base(f){sub(".*/", "", f); return f;} \ | |
{print length(base($0)), $0}'| sort -nr | head -2 | |
#Longest line | |
find . -name '*.cs' -print | xargs awk '{print length, $0}' | sort -nr | head -1 | |
#Longest namespace | |
find . -name '*.cs' -print | xargs awk '{print length, $0}' |sort -nr | grep namespace | head -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;https://insitux.repl.co/ | |
;https://insitux.github.io/ | |
;https://royalur.net/rules/ | |
;https://royalur.net/dice/ | |
(var cmds "1234567ABCDEFG") | |
(function roll | |
(times 4 #(rand-int))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function check | |
(let [[a _ x] [_ b] [z _ c]] board) | |
;Check diagonals | |
(when (or (= a b c) (= x b z)) (return b)) | |
;Check horizontals and verticals | |
(let board+T (into board (.. map vec board))) | |
(when (let [w] (find (.. =) board+T)) w)) | |
(function place n xo | |
(var! board (set-at [(// n 3) (rem n 3)] xo))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(var W 80 H 25 | |
chars ".,-~:;=!*#$@" | |
PI2 (* 2 PI) | |
speed-A .05 speed-B .05 speed-I .05 speed-J .05 | |
a 0 b 0) | |
(var last-ms (time)) | |
(function calculate-screen screen | |
(let prev-ms last-ms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pipe = | |
<Ctx, Ingress, A, B, C, Egress>( | |
...args: | |
| [(x: Ingress, ctx: Ctx) => Promise<Egress>] | |
| [ | |
(x: Ingress, ctx: Ctx) => Promise<A>, | |
(x: A, ctx: Ctx) => Promise<Egress> | |
] | |
| [ | |
(x: Ingress, ctx: Ctx) => Promise<A>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name YouTube budget | |
// @version 0.1.2 | |
// @description Budgets YT time | |
// @author Patrick Bowen | |
// @match https://www.youtube.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com | |
// @grant none | |
// ==/UserScript== |
OlderNewer