Skip to content

Instantly share code, notes, and snippets.

View fearphage's full-sized avatar
⌨️
Cache rules everything around me.

Phred Lane fearphage

⌨️
Cache rules everything around me.
View GitHub Profile
@fearphage
fearphage / README.md
Last active October 18, 2022 20:19
$.whenAll jQuery extension

$.whenAll is an extension to jQuery's $.when. The main difference is $.when stops when it receives the first rejected promise. This extension treats all successes and failures as progress events. After all the promises have completed, the global promise is resolved if there were no errors. Otherwise the global promise is rejected.

Sameple #1

$.whenAll($.get('http://github.com'), $.get('good luck with this one'))
  .then(
    // success callback
    function(request) {}
    // failure callback - called once at the end
 ,function() {}
@fearphage
fearphage / README.md
Last active August 22, 2022 21:08
Modifying Archidekt to add some convenience functionality

Archidekt Enhancements

Current Functionality

Quick Add

  1. Enter selects the first element in the dropdown.
  2. Ctrl-Enter adds the selected card to the maybeboard.
  3. Shift-Enter adds the selected card to the sideboard.
@fearphage
fearphage / README.md
Created September 20, 2012 14:45
Can you make this faster?

The goal is to add N new elements to the DOM as quickly and as painlessly as possible.

I have access to jQuery and found the code below to be faster than the following:

$(parentElement)
  .append(Array(1001).join(template))
;
@fearphage
fearphage / README
Created May 12, 2011 17:20
"VERIFY MY ACCOUNT" facebook worm source
Original source of self-propagating Facebook worm
Original location: http://pelorak.info/verify.js
@fearphage
fearphage / clap.sh
Created January 24, 2020 16:02
Command Line Audio Playlist
#!/bin/bash
# Requirements: dialog mpv
# Optional: youtube-dl wget hq
# Arguments: none
#
# Changelog:
# > + from function to standalone script
# + menu stack for saving previous menu command
# + choices stack for saving previous menu choice
@fearphage
fearphage / multiple_ssh_setting.md
Created December 30, 2019 04:07 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
# Python/Django files
*.pot
*.py[cod]
# Folder view configuration files
.DS_Store
Desktop.ini
# Thumbnail cache files
._*
@fearphage
fearphage / README.md
Created September 11, 2019 17:26
Collection of shell functions wrapping the Azure CLI

az-get

Returns a property value of a resource passing additional params as needed.

Usage

az-get <resource> <property> [additional params]
@fearphage
fearphage / meh.sh
Created July 10, 2019 11:59
Does mapfile work on a mac?
#!/usr/bin/env bash
mapfile -t meh < <(ps -ax)
echo "found ${#meh[@]} processes"
@fearphage
fearphage / System Design.md
Created May 3, 2016 16:58 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?