Skip to content

Instantly share code, notes, and snippets.

joshbuchea /
Created Aug 8, 2019 — forked from matteocrippa/
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
joshbuchea / slugify.js
Created Aug 22, 2018 — forked from hagemann/slugify.js
Slugify makes a string URI-friendly
View slugify.js
function slugify(string) {
const a = 'àáäâãåèéëêìíïîòóöôùúüûñçßÿœæŕśńṕẃǵǹḿǘẍźḧ·/_,:;'
const b = 'aaaaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh------'
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
joshbuchea / react-example-bare-minimum.html
Last active Jun 27, 2018
React Example: Bare Minimum
View react-example-bare-minimum.html
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>React Example: Bare Minimum</title>
<link rel="icon" href="" />
joshbuchea / suckData.js
Created Jan 22, 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>
joshbuchea / index.js
Created Jul 21, 2017 — forked from stan229/index.js
React Navigation and Redux example
View index.js
import React, { Component } from "react";
import { Text } from "react-native";
import { Provider, connect } from "react-redux";
import { StackNavigator, addNavigationHelpers } from "react-navigation";
import Routes from "./config/routes";
import getStore from "./store";
const AppNavigator = StackNavigator(Routes);
joshbuchea /
Created Jun 21, 2017 — forked from cvan/
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default


CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
joshbuchea / starter-styles.css
Last active Mar 29, 2018
Sensible CSS Styles
View starter-styles.css
* Page Defaults
/* Bootstrap 4 Reboot: */
/* Bootstrap 4 Reboot CSS: */
/* global box-sizing */

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional


joshbuchea / .gitignore
Last active Dec 29, 2019
Git Ignore Examples
View .gitignore
# node.js #
# Packages #
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
View favicons.html
<link rel="icon" type="image/png" sizes="192x192" href="/favicons/android-chrome-192x192.png">
<link rel="manifest" href="/manifest.json">
<meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#ffffff">
<meta name="application-name" content="AMP by Example">
<link rel="apple-touch-icon" sizes="57x57" href="/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/favicons/apple-touch-icon-72x72.png">