Skip to content

Instantly share code, notes, and snippets.

@oscherler
oscherler / README.md
Last active April 6, 2023 10:03
Diff JSON in Git using gron

jsondiff: diff JSON in Git using gron

gron is an incredible tool that makes JSON greppable. But it also makes it diffable, which is great if you have JSON files in Git.

To use gron to diff JSON in Git, save the json-diff script below and make it executable. Then add a difftool as shown in gitconfig, and optionally create an alias to invoke it more easily. Then try it:

git init
echo '{"foo":42,"bar":"hello"}' > foo.json
git add foo.json && git commit -m 'Initial commit.'
@romainl
romainl / redir.md
Last active March 22, 2024 17:09
Redirect the output of a Vim or external command into a scratch buffer

Redirect the output of a Vim or external command into a scratch buffer

Usage (any shell)

Show full output of command :hi in scratch window:

:Redir hi

Show full output of command :!ls -al in scratch window:

function ghq-fzf() {
local selected_dir=$(ghq list | fzf --query="$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd $(ghq root)/${selected_dir}"
zle accept-line
fi
zle reset-prompt
}
# Basic commands
:Git [args] # does what you'd expect
all of your `~/.gitconfig` aliases are available.
:Git! [args] # same as before, dumping output to a tmp file
Moving inside a repo.
@ksiggaard
ksiggaard / style.less
Last active October 23, 2017 17:31
Fira Code & Flottflott highlighting in Atom
/*
* Code by William Chang and Matt McFarland
* https://medium.com/@docodemore/an-alternative-to-operator-mono-font-6e5d040e1c7e#.ofkdp0aww
* flottflott - http://www.dafont.com/flottflott.font
* Fira Code - https://github.com/tonsky/FiraCode
*/
atom-text-editor {
font-family: 'Fira Code';
font-style: normal;
@delta-bravo
delta-bravo / pom.xml
Last active April 19, 2021 01:54
Maven Shade + Spring Boot POM
<!--To be included in <build> <plugins> section-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.4.0.RELEASE</version>
@ipcjs
ipcjs / +Rime+小鹤双拼+颜文字+笔画混合输入方案.md
Last active March 8, 2024 07:03
Rime+小鹤双拼+颜文字+笔画混合输入方案

Rime+小鹤双拼+颜文字+笔画混合输入方案

概述

方案配置文件+详细说明:Rime+小鹤双拼+颜文字+笔画混合输入方案

实现的功能是:给小鹤双拼添加颜文字支持,直接打双拼出颜文字,支持模糊音,支持词频调整,同时不影响小鹤双拼自带的笔画反查。

要实现双拼+颜文字的功能网上已经有很多方法,但都有些弊端,这里分别简单介绍下:

@VincentSit
VincentSit / update_gfwlist.sh
Last active March 24, 2024 14:39
Automatically update the PAC for ShadowsocksX. Only tested on OS X. (Deprecated)
#!/bin/bash
# update_gfwlist.sh
# Author : VincentSit
# Copyright (c) http://xuexuefeng.com
#
# Example usage
#
# ./whatever-you-name-this.sh
#
# Task Scheduling (Optional)