Skip to content

Instantly share code, notes, and snippets.

@dslounge
dslounge / fzf-cat.sh
Created April 11, 2020 04:47
fzf cat demo
fzf --preview 'bat {-1} --color=always'
@dslounge
dslounge / gdiff.sh
Last active April 9, 2020 16:29
Better git diffs with fzf
# put this in your .bashrc or .zshrc
fd() {
preview="git diff $@ --color=always -- {-1}"
git diff $@ --name-only | fzf -m --ansi --preview $preview
}
@dslounge
dslounge / lint changes.sh
Created May 13, 2019 18:31
eslint the javascript files changed on your branch
git diff master... --name-only | grep -E '.js$' | xargs ./node_modules/eslint/bin/eslint.js

Keybase proof

I hereby claim:

  • I am dslounge on github.
  • I am groundcontrol (https://keybase.io/groundcontrol) on keybase.
  • I have a public key ASBH_UT7HmI1ZHevwgHVTqNEEnac9v2zvJkM1gdHr5Fdtwo

To claim this, I am signing this object:

@dslounge
dslounge / cached-fetch.js
Last active May 6, 2020 08:31
cache fetch in React Native
export const cachedFetch = url => {
const key = `@MySuperStore:${url}`;
return AsyncStorage.getItem(key)
.then(data => {
if (!data) {
return Promise.reject("no data found in async storage");
}
console.log("found data on disk");
return JSON.parse(data);
})
@dslounge
dslounge / font-awesome.json
Last active August 14, 2016 00:30
A font awesome JSON mapping
{
"fa-glass": "\uf000",
"fa-music": "\uf001",
"fa-search": "\uf002",
"fa-envelope-o": "\uf003",
"fa-heart": "\uf004",
"fa-star": "\uf005",
"fa-star-o": "\uf006",
"fa-user": "\uf007",
"fa-film": "\uf008",
@dslounge
dslounge / airbnb_copy.js
Last active March 9, 2016 02:30
Half-assed JS for copying AirBnB information into a google spreasheet
/*
Comparing AirBnB information and sharing it with your friends so you can decide where to stay is a pain in the ass.
When you're looking at an AirBnB listing, you can copy and paste this thing into the Chrome developer console to get basic information on your clipboard. You'll then be able to paste directly onto a google spreadsheet.
It copies:
- price per night
- total price
- name
- number of reviews