Skip to content

Instantly share code, notes, and snippets.

View cameck's full-sized avatar
🍩
(ॢ◕ัڡ ◕ั ॢ)

Cameron Eckelberry cameck

🍩
(ॢ◕ัڡ ◕ั ॢ)
View GitHub Profile
def sum(arr)
arr.empty? ? 0 : arr.shift + sum(arr)
end
function injectGitFileStatus()
{
const timeout = 5000;
const addedColor = "#98C379";
const modifiedColor = "#D19A66";
const stagedColor = "#E06059";
const ignoredOpacity = "0.4";
const explorer = document.getElementById("workbench.view.explorer");
if (explorer)

Vim Cheat Sheet

Navigation

  • End of the file: shift + g
  • Next line: j
  • Go down a defined number of lines: number + j
  • Skip to next word: w
  • Skip back a word: b
  • Skip to next section: W
@cameck
cameck / fetchApiCall.js
Created September 8, 2019 23:06
An API Call helper function for native fetch calls. Abstracts away a lot of common boilerplate in error handling and JSON parsing. Comments are welcome 🤙
/**
* Callback for passing back result data.
* @callback updateCallback
* @param {string} result - A success or error string
*/
/**
* Callback to run after all is done.
* @callback finalCallback
*/