Skip to content

Instantly share code, notes, and snippets.

View janosorcsik's full-sized avatar

János Orcsik janosorcsik

View GitHub Profile
@ryanml
ryanml / stranger-things.bas
Last active May 13, 2018 02:48
Bob's Password Brute-Forcer from Stranger Things Season 2
10 DIM FourDigitPassword INTEGER
20 FOR i = 0 TO 9
30 FOR j = 0 TO 9
40 FOR k = 0 TO 9
50 FOR l = 0 TO 9
60 FourDigitPassword = getFourDigits (i,j,k,l)
70 IF checkPasswordMatch(FourDigitPassword) = TRUE THEN
80 GOTO 140
90 END
100 NEXT l
@robvolk
robvolk / .bash_profile.sh
Created August 21, 2018 16:58
Cleanup git branches
gitc() {
git fetch --prune
for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`;
do
git branch -D $branch
done;
git branch --merged master | grep -v '^*' | grep -v '^ master$' | xargs git branch -d
}
@romkatv
romkatv / Pure style for Powerlevel10k.md
Last active May 4, 2024 16:34
Pure style for Powerlevel10k

Powerlevel10k can generate the same prompt as Pure.

pure

Installation

git clone https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
@evici
evici / default-finder-view
Created January 16, 2020 18:28
Set Default Finder View and Arrange By Options
1. Backup com.apple.finder.plist
cp ~/Library/Preferences/com.apple.finder.plist ~/Desktop
2. Set top-level defaults using the defaults command
Default to list view:
defaults write com.apple.finder FXPreferredViewStyle Nlsv
Default Arrange By flags that don't seem to be effective:
defaults write com.apple.finder FXArrangeGroupViewBy kind
defaults write com.apple.finder FXPreferredGroupBy kind
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div