Skip to content

Instantly share code, notes, and snippets.


Josh Buchea joshbuchea

View GitHub Profile
seunggabi /
Last active Jun 2, 2020

Semantic Branch Names

See how a minor change to your branch name style can make you a better programmer.

Format: <type>/#<issueNumber>-<alias>


jeanlucaslima /
Last active May 28, 2020
Remote Work Resources

Remote Jobs general guideline

This is something I compiled during the last weeks while job hunting. If you miss something in this list, please fork or tell me on twitter and I'll add what's missing.

  1. Be careful with jobs that are not clear they hire outside US
  2. Look for job in niches (like SaaS job boards, language-specific communities, country-focused, and so on)
  3. Avoid Upwork (pay to work, no guaranteed results, often bad contracts) and
  4. is not, is ok.
  5. There are companies that hire and act as a guild, but only pay as freelancer (X-team,, and so on)
  6. Not really focused on freelancing, as it is to me more like a one-person business
mikaello /
Last active Nov 26, 2020 — forked from JamieMason/
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Keys or Property Values

This fork of JamieMason's implementation changes the key parameter to be an array of keys instead of just a single key. This makes it possible to group by multiple properties instead of just one.


const groupBy = keys => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = => obj[key]).join('-');
matthargett /
Created Nov 19, 2018
TypeScript versus flowtype

First, let's note the difference in philosophy: TypeScript aims for fast analysis because you can to compile it down to JS before you can run/test it. flowtype is meant to be an async analysis that can run continuously with changes since the last analysis, or in parallel with your eslint and bundler rules. As such, flowtype's type system and analysis is not quite as concerned with speed or memory usage in service of potentially finding more bugs.

On two occasions I have tried to roll out flow in React Native applications, and on those two occasions we ended up backing out after a few weeks. Some detail: flow doesn't have a public roadmap, and what version you use is dictated by the react/react-native dependency and the annotations in react-native itself. flowtype also has some hard-coded aspects to help the analysis for React, so major updates to React itself sometimes also require updating flowtype to match. React Native upgrades then get gated based on your dependent libraries (or flow-typed) being updated

JamieMason /
Created Sep 14, 2018
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value


const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
hagemann / slugify.js
Last active Nov 21, 2020
Slugify makes a string URI-friendly
View slugify.js
function slugify(string) {
const a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;'
const b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
.replace(/&/g, '-and-') // Replace & with 'and'
.replace(/[^\w\-]+/g, '') // Remove all non-word characters
Frondor / suckData.js
Last active Sep 27, 2018
HTML table data to JSON
View suckData.js
* ~ but a personal snippet
* Sometimes when prototyping my designs, I like to get dummy data pretty fast.
* I use this snippet to extract that data from working (aka "real life") tables from other HTML tables I find on the net.
* So I'll need that same data but inside an object.
* This script assumes by default the table has the following structure:
* <table>
matteocrippa /
Last active Sep 22, 2020
a script to quick setup my dev Mac
#!/usr/bin/env bash
echo "Install XCode first"
xcode-select --install
# Setup directories
mkdir ~/Projects
mkdir ~/Projects/Repositories
mkdir ~/Projects/Material
narainsagar / nodejs - get filesize in readable
Last active Mar 11, 2020
node.js - function to get file and convert the file size in humanly readable format.
View nodejs - get filesize in readable

node.js - get the filesize in human readable format.

This will take filePath as a function parameter and reads the file via fs module and get the file and converts it's size into more humanly readable format.

const fs = require('fs');
function getFileSize(filename) {
  const stats = fs.statSync(filename);
  //console.log('stats', stats);
  const {size} = stats;
zcorpan /
Last active Sep 20, 2016
#HTMLQuiz what happens (iframe escape)

#HTMLQuiz what happens?

<iframe id=x></iframe>
  • wild DOMException appears
  • iframe escapes
You can’t perform that action at this time.