Skip to content

Instantly share code, notes, and snippets.

@2-3-5-7
2-3-5-7 / 欧路.ahk
Last active January 26, 2025 06:13
欧路取词脚本
popup := true
eudic_loc := "D:\soft\eudic\eudic.exe"
; IconIndex 通过 python LnkParse3 查看,或 WinHex 偏移 56 位置的值,再加 1
TraySetIcon("Shell32.dll", 44)
#SuspendExempt
; PauseBreak 开关脚本
Pause::Suspend()
#SuspendExempt False

Preparing for Behavioural Interviews at Tech Companies

So, you're applying for a tech company internship/grad role? Made it past the hackerrank, and now they want to ... talk to you? Exciting! Scary! But don't be alarmed, you'll do OK.

This short Gist contains all my best advice for how to prepare to do well in a behavioural interview. It's focussed at junior roles, but I suspect much of the advice is equally applicable for more senior roles too.

@osipxd
osipxd / !paper-versions.md
Last active January 26, 2025 06:10
Paper versions links
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@emilyliu7321
emilyliu7321 / bluesky-comments.tsx
Created November 25, 2024 05:39
Integrate Bluesky replies as your blog's comment section
"use client";
/* eslint-disable @next/next/no-img-element */
import Link from "next/link";
import { useState, useEffect } from 'react';
import {
AppBskyFeedDefs,
AppBskyFeedPost,
type AppBskyFeedGetPostThread,
} from "@atproto/api";
@echohive42
echohive42 / gist:acbecaeee02ebf10e422095d01de397b
Last active January 26, 2025 06:12
deepseek-r1 multi-think output
{
"timestamp": "2025-01-25T21:47:37.634489",
"question": "why does language exist?",
"n_approaches": 5,
"approach_list": [
"Anthropological perspective",
"Evolutionary biology",
"Cognitive science",
"Theoretical linguistics",
"Sociocultural analysis"
@ramonsmits
ramonsmits / ByteArrayExtensions.cs
Last active January 26, 2025 06:07
c# byte array extensions to find first or last index of byte pattern/sequence in byte array
using System;
/// <summary>
/// Simple byte sequence finder. The code can be optimized a little bit like embedding the byte comparison in the for loop. Not sure if the .net compiler does this optimization.
/// Probably can be faster with some search algorithm but I just needed a small and readable fast enough version
/// </summary>
static class ByteArrayExtensions
{
public static long LastIndexOf(this byte[] data, byte[] pattern)
{
if (data == null) throw new ArgumentNullException(nameof(data));

My Personal Constitution: A Living Document

Preamble: Embracing the Flow of Existence

This Personal Constitution is a living document, reflecting my ongoing journey of self-discovery and engagement with the world. It is not a rigid set of rules, but a guiding framework based on the truths I have found in my experiences, thoughts, and explorations. It emphasizes embracing the dynamic nature of life, the pursuit of knowledge and wisdom, and the importance of contributing positively to humanity.

Core Values:

1. The Pursuit of Knowledge and Wisdom: A Lifelong Journey

@vgel
vgel / r1.py
Last active January 26, 2025 06:00
script to run deepseek-r1 with a min-thinking-tokens parameter, replacing </think> with a random continuation string to extend the model's chain of thought
import argparse
import random
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache
import torch
parser = argparse.ArgumentParser()
parser.add_argument("question", type=str)
parser.add_argument(
@GiggleLiu
GiggleLiu / wyckoff_assign.jl
Last active January 26, 2025 06:07
Wyckoff position assignment - Given atoms counting and Wyckoff position multiplicity
using JuMP, HiGHS, Graphs, LinearAlgebra, Test
# Find one valid assignment with integer programming
function lattice_sites(num_sites::Vector{Int}, multiplicity::Vector{Int}, num_atoms::Vector{Int})
model = Model(HiGHS.Optimizer)
JuMP.set_silent(model)
@variable(model, x[1:length(num_sites), 1:length(num_atoms)] >= 0, Int)
for (ia, na) in enumerate(num_atoms)
@constraint(model, sum(x[i, ia] * num_sites[i] for i in 1:length(num_sites)) == na)
end