Skip to content

Instantly share code, notes, and snippets.

View kkharji's full-sized avatar
🚀
building spaceships

kkharji

🚀
building spaceships
View GitHub Profile
@luckman212
luckman212 / popper.lua
Last active January 31, 2022 05:42
quick popup note window for Hammerspoon
-- popper.lua
-- https://www.hammerspoon.org/docs/hs.webview.html
src=[[<html>
<head>
<style>
::-webkit-scrollbar {
background: #2d2e26;
width: 8px;
@kotatsuyaki
kotatsuyaki / vlang.nix
Created November 7, 2021 06:13
Dirty nix derivation for vlang
{ pkgs, lib, stdenv, fetchFromGitHub, glfw, freetype, openssl, makeWrapper, upx, git, strace, binutils-unwrapped, libGL, boehmgc, sqlite, libexecinfo, xorg, valgrind }:
stdenv.mkDerivation rec {
pname = "vlangg";
version = "weekly.2021.44";
src = fetchFromGitHub {
owner = "vlang";
repo = "v";
rev = version;
-- Thanks @tjdevries !
-- neovim
-- Complete matching lines
-- See :help ins-completion
function CompleteMatchingLine()
local current_line = vim.api.nvim_get_current_line()
current_line = vim.trim(current_line)
if not current_line then
{config, pkgs, ...}:
{
# Enable Nginx
services.nginx = {
enable = true;
# Use recommended settings
recommendedGzipSettings = true;
recommendedOptimisation = true;
@troyfontaine
troyfontaine / 1-setup.md
Last active May 12, 2024 15:17
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@olih
olih / jq-cheetsheet.md
Last active May 9, 2024 19:35
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@CodeTheInternet
CodeTheInternet / gist:9312404
Last active January 1, 2024 11:30
JSON with country data, including base64 encoded flag images
[{"id":1,"name":"Afghanistan","isoAlpha2":"AF","isoAlpha3":"AFG","isoNumeric":4,"currency":{"code":"AFN","name":"Afghani","symbol":"؋"},"flag":"iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUCAIAAAAVyRqTAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo3REQwQzQwNjE3NTMxMUUyODY3Q0FBOTFCQzlGNjlDRiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo3REQwQzQwNzE3NTMxMUUy
@lyoshenka
lyoshenka / search-git-history.md
Last active April 26, 2024 23:16
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@moyashi
moyashi / getPageTitleAndURLFromFirefox.scpt
Created May 26, 2011 21:33
Firefoxで表示中のページタイトルとURLをカーソル位置にリンクで貼り付けるTypeIt4Me( http://bit.ly/iorZdU )用スクリプト
--「システム環境設定>ユニバーサルアクセス>補助装置にアクセスできるようにする」のチェックボックスをONにする必要あり
--また、環境によってdelay1, delay2を調整する必要があるかもしれません
global format
global delay1
global delay2
--リンクの書式を変える場合はformatを変更
set format to "<a href=\"$url$\" target=\"_blank\">$title$</a>"