Skip to content

Instantly share code, notes, and snippets.

View crispgm's full-sized avatar
Caffeinated

David Zhang crispgm

Caffeinated
View GitHub Profile

Some useful custom text objects for vim

Collection of my custom text objects I use quite often.

97975602 6e90ee00 1dda 11eb 9286 6894300457e3

Numbers

Put it into your .vimrc:

@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active June 22, 2024 17:41
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@crispgm
crispgm / this_year_rails.rb
Created July 4, 2017 03:03
Monkey partch to add `this_year?` to Rails
module DateAndTime
module Calculations
def this_year?
year == ::Date.current.year
end
end
end
@crispgm
crispgm / forked-repo-ahead-master.md
Created September 24, 2016 02:21
Forked repo is ahead of master
git checkout master
git reset --hard upstream/master
git push --force
@jaredallard
jaredallard / string.split.lua
Created May 21, 2015 05:07
string.split in lua
-- split a string
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
@steve-jansen
steve-jansen / README.md
Last active May 21, 2024 04:59
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@mangelajo
mangelajo / URLs from app olympus share app
Last active February 28, 2023 06:10
Olympus Share E-M10 camera
Olympus Share APP control urls over E-M10 camera, still to investigate..
http://192.168.0.10
http://192.168.0.10/
http://192.168.0.10/clear_resvflg.cgi
http://192.168.0.10/exec_pwoff.cgi
http://192.168.0.10/exec_shutter.cgi?com=1st2ndpush
http://192.168.0.10/exec_shutter.cgi?com=1stpush
http://192.168.0.10/exec_shutter.cgi?com=1strelease
http://192.168.0.10/exec_shutter.cgi?com=2nd1strelease
@bwhite
bwhite / rank_metrics.py
Created September 15, 2012 03:23
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 23, 2024 09:05
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@MicahElliott
MicahElliott / colortrans.py
Created November 29, 2010 07:57
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code