Skip to content

Instantly share code, notes, and snippets.

View jsatk's full-sized avatar
💀

Jesse Atkinson jsatk

💀
View GitHub Profile
@jsatk
jsatk / Prompts
Created October 29, 2014 23:22
My bash and fish shell prompts
# For Bash. Photo here: http://i.jsatk.us/image/403u443G2k06
PS1="\n\[$RESET\]┌─▪\[\e]2;$PWD\[\a\]\[\e]1;\]$(basename "$(dirname "$PWD")")/\W\[\a\]\[${BOLD}${MAGENTA}\]\u \[$WHITE\]on \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$RESET\]\n└─▪ "
# For Fish. Photo here: http://i.jsatk.us/image/1Z0m132j181I
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
echo
set_color magenta
var start, end, diff, splitString, nativeArray;
splitString = function () {
return 'foo bar baz bing ding dong lars foo bar baz bing ding dong lars foo bar baz bing ding dong lars foo bar baz bing ding dong lars foo bar baz bing ding dong lars foo bar baz bing ding dong lars'.split(' ');
};
nativeArray = function () {
return ['foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars', 'foo', 'bar', 'baz', 'bing', 'ding', 'dong', 'lars'];
};
@jsatk
jsatk / longestPrefix.js
Created December 15, 2014 18:27
Finds the longest prefix in an array of strings
var longestPrefix = function (arr) {
var firstString = arr[0],
prefix = '';
for (var i = 0; i < firstString.length; i++) {
for (var j = 1; j < arr.length; j++) {
if (arr[j].charAt(i) !== firstString.charAt(i)) {
return prefix;
}
}
@jsatk
jsatk / serialize.js
Created December 15, 2014 23:56
URI Encode JS Object
var serialize = function (obj) {
var str = [];
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
str.push(encodeURIComponent(prop) + "=" + encodeURIComponent(obj[prop]));
}
}
return str.join("&");
set t_ZH=^[[3m
set t_ZR=^[[23m
function tmux — description Run\ tmux\ with\ support\ for\ italics
env TERM=myterm-it tmux -2 $argv
end
import thirdPartyClient from 'some-third-party-client'
import myApi from '../../src/my-api'
describe('myApi', () => {
describe('Error handling', () => {
const myRejection = {
errorCode: 404,
errorMessage: 'You broke everything',
errorUrl: 'http://coolapp.api.docs/error/404/'
}
import thirdPartyClient from 'some-third-party-client'
import myApi from '../../src/my-api'
describe('myApi', () => {
describe('Error handling', () => {
const myRejection = {
errorCode: 404,
errorMessage: 'You broke everything',
errorUrl: 'http://coolapp.api.docs/error/404/'
}
@jsatk
jsatk / 2017-best-of-albums.md
Last active December 21, 2017 17:16
Favorite Albums of 2017

2017 — Best Albums Of

  1. Jason Isbell & the 400 Unit “Nashville Sound”
  2. Thundercat “Drunk”
  3. Fleet Foxes “Crack Up”
  4. Converge “The Dusk In Us”
  5. Gorillaz “Humanz”
  6. Kendrick Lamar “DAMN.”
  7. Ryan Adams “Prisoner”
  8. The War on Drugs “A Deeper Understanding”
@jsatk
jsatk / 2017-best-movies.md
Last active November 25, 2017 19:01
List of Best Movies of 2017

Best Movies of 2017

Movies I've Seen

Thor: Ragnarok The Killing of a Sacred Deer A Ghost Story Blame! Wonder Woman Get Out