Skip to content

Instantly share code, notes, and snippets.

View nickkaczmarek's full-sized avatar
🌊

Nick Kaczmarek nickkaczmarek

🌊
View GitHub Profile
@nickkaczmarek
nickkaczmarek / apply-anchor-tags-to-headers-with-ids.js
Created October 6, 2023 12:50
Apply Anchor Tags to Headers with Ids
// ==UserScript==
// @name Apply Anchor Tags to Headers with Ids
// @description Finds all header tags that have ids and puts an anchor inside it
// @match *://*/*
// @exclude https://imois.in/games/travle/*
// ==/UserScript==
function applyAnchorTagsToHeadersWithIds() {
// get all header elements on the page
const headers = document.querySelectorAll("h1, h2, h3, h4, h5, h6")
@nickkaczmarek
nickkaczmarek / find_jsc.sh
Created December 2, 2020 02:57
Find where jsc is the framework
find /System/Library/Frameworks/JavaScriptCore.framework -iname jsc
@nickkaczmarek
nickkaczmarek / gist:349968b263af5b42093641e791d0397a
Created November 2, 2020 21:55
fix zsh compinit perm issues
# zsh compinit: insecure directories, run compaudit for list.
# Ignore insecure directories and continue [y] or abort compinit [n]?
$ sudo chmod -R 755 /usr/local/share/zsh
$ sudo chown -R root:staff /usr/local/share/zsh
@nickkaczmarek
nickkaczmarek / starttmux.sh
Created October 15, 2020 21:14
starttmux.sh for windows
#!/bin/bash
session="work"
if ( ps aux | grep tmux )
then
echo tmux is running
tmux attach-session -t $session
else
echo tmux is not running
@nickkaczmarek
nickkaczmarek / UISlider.swift
Created June 27, 2020 22:28 — forked from westerlund/UISlider.swift
Snapping UISlider in Swift
final class SnappingSlider: UISlider {
override var value: Float {
set { super.value = newValue }
get {
return round(super.value * 1.0) / 1.0
}
}
}
@nickkaczmarek
nickkaczmarek / Counter.js
Last active June 22, 2019 01:45
dotnet core react component useState
import React from 'react';
export function Counter() {
const [currentCount, incrementCounter] = React.useState(0);
return (
<div>
<h1>Counter</h1>
@nickkaczmarek
nickkaczmarek / tmux.md
Created May 25, 2019 20:35 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@nickkaczmarek
nickkaczmarek / windows git bash pacman.md
Last active May 22, 2019 15:28
windows git bash pacman

Install pacman for git bash

  1. install git for windows
  2. install msys2 https://www.msys2.org/
  3. follow instructions to update pacman and install packages
  4. copy everything from msys2/usr/bin to Program Files/git/usr/bin
  5. copy msys2/etc/pacman.d and msys2/etc/pacman.conf to the same places in Program Files/git/
  6. copy msys2/var to git/var
  7. you should be able to run pacman in git bash now
@nickkaczmarek
nickkaczmarek / tmux_commands.md
Last active July 30, 2018 14:58 — forked from Alek-S/tmux_commands.md
tmux Commands

Start new named session:

tmux new -s [session name]

List sessions:

tmux ls

Attach to named session:

tmux a -t [name of session]

Kill named session:

# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png
# A big thanks to \amethyst on Freenode
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then TERM=gnome-256color; fi
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)