Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Scrollbar</title>
<style>
.scroll-box {
position: relative;
width: 300px; /* Adjust to fit your design */
@saxxie-dev
saxxie-dev / tiktok-blockout-helper.js
Created May 12, 2024 21:37
Simple script for blocking people on the tiktok web search page. Be careful when copy-pasting code from the internet!
// Grab csrf token to get around XSS controls.
const csrfToken = JSON.parse(__UNIVERSAL_DATA_FOR_REHYDRATION__.textContent).__DEFAULT_SCOPE__["webapp.app-context"].csrfToken;
// Eavesdrop on search requests and create mapping between userId and sec_uid
const userIdMapping = new Map();
const realFetch = fetch;
window.fetch = (url, ...vars) => {
return realFetch(url, ...vars).then(async (res) => {
if (url.toString().match(/search\/user\/full/)) {
// After getting new results, add block button to them

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Scrollbar</title>
<style>
.scroll-box {
position: relative;
width: 300px; /* Adjust to fit your design */

Comment to https://www.reddit.com/r/ProgrammingLanguages/comments/1cphrxp/is_this_a_sane_set_of_tokens_for_my_lexer_a_few/

Also, do you guys have any resources on algorithms on ASTs, for type checking, maybe about linear typing and borrow checking as well? That's assuming the AST is the place where I'm supposed to check this sort of stuff.

There are a number of different approaches to typechecking, so there isn't a single answer or direction to go. For systems that support strong type inference, there are two well-known approaches: Hindley-Milner (HM) and bidirectional (bidir) systems, and these approaches aren't entirely separate (HM is often put in bidirectional checking to help with generics). There is also the simpler unidirectional approach taken by older languages e.g. Java, and the simpler way of handling generics by annotating every generic function and datastructure.

Giving direction on typechecking is unfortunately difficult because it is opinionated, because there is a line to straddle with wh

@pauloromeira
pauloromeira / tlp
Last active May 12, 2024 21:36
My TLP config file (/etc/default/tlp) for ThinkPad
# ------------------------------------------------------------------------------
# tlp - Parameters for power saving
# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html
# dir: /etc/default/tlp
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.
@wilr
wilr / admin.yml
Last active May 12, 2024 21:34
Big & Beautiful Silverstripe Elemental Previews
---
Name: "admin-custom"
---
SilverStripe\Admin\LeftAndMain:
extra_requirements_css:
- "app/client/element-preview.css"
@halicki
halicki / mc-wrapper.fish
Last active May 12, 2024 21:34
Midnight commander wrapper script for the fish shell
function mc
set SHELL_PID %self
set MC_PWD_FILE "/tmp/mc-$USER/mc.pwd.$SHELL_PID"
/usr/bin/mc -P $MC_PWD_FILE $argv
if test -r $MC_PWD_FILE
set MC_PWD (cat $MC_PWD_FILE)
if test -n "$MC_PWD"
@lukecyca
lukecyca / gist:9f88aad1b6473047ec7a0d5a8afd37fe
Created July 19, 2020 18:18
Capture data from MrCool Cielo mini split
import requests
import json
session = requests.Session()
def login(username, password):
# Initial request - get session id
r = session.get('https://smartcielo.com/')
//
// CloudCompositingView.swift
// OpenSwiftUIDesigns
//
// Created by Amos Gyamfi on 9.4.2024.
//
import SwiftUI
struct CloudCompositingView: View {