Skip to content

Instantly share code, notes, and snippets.

View jeromecovington's full-sized avatar

Jerome Covington jeromecovington

View GitHub Profile

Cheat sheet: JavaScript Array methods

Deriving a new Array from an existing Array:

['■','●','▲'].slice(1, 3)           ['●','▲']
['■','●','■'].filter(x => x==='■')  ['■','■']
    ['▲','●'].map(x => x+x)         ['▲▲','●●']
    ['▲','●'].flatMap(x => [x,x])   ['▲','▲','●','●']
@dino-
dino- / haskell-symbols.md
Last active March 20, 2024 05:38
Haskell symbols

Haskell symbols

When starting out with Haskell, I found it difficult to read a lot of the symbols. I made this document explaining the names of some symbols and how I read them.

:: "has type"

x :: Int

@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@tkrynski
tkrynski / gist:8943112
Created February 11, 2014 20:11
How to compare two redis dbs
@sukima
sukima / jsbin_settings.js
Last active December 11, 2015 23:38
My personalized settings for JSBin.com
(function(settings, libraries) {
localStorage.setItem('settings', JSON.stringify(settings));
localStorage.setItem('libraries', JSON.stringify(libraries));
setTimeout(function() {
window.location = window.location; // Force refresh
}, 0);
})(
//Settings
{
"panels": [
@laszlomiklosik
laszlomiklosik / Git: undo git rm for a single file
Created October 4, 2012 14:43
Git: undo git rm for a single file
git checkout HEAD path/to/file
# Without HEAD it's not working because the file is not there anymore