Skip to content

Instantly share code, notes, and snippets.

View michaelhayman's full-sized avatar

Mike D michaelhayman

View GitHub Profile
module.exports = {
plugins: [
{
resolve: `gatsby-source-graphql`,
options: {
typeName: `GraphCMS`,
fieldName: `gcms`,
url: `https://api-eu-central-1.graphcms.com/v2/ckjp80jbpftcp01z10zldgn49/master`
}
}
@michaelhayman
michaelhayman / site_settings.json
Created February 23, 2020 19:01
Jobby JSON for sites
// make each key a different field on sites table
{
global_sections: [
{
type: 'header'
}
],
colors: {
text: {
@michaelhayman
michaelhayman / flatten-integers.js
Last active February 7, 2019 10:46
Flatten an array of arbitrarily nested arrays of integers into a flat array of integers
// flatten an array of arbitrarily nested arrays of integers
// into a flat array of integers.
// e.g. [[1,2,[3]],4] -> [1,2,3,4]
//
// could be extended to check for objects, etc. but spec says to only
// expect integers.
const flattenIntegers = (array, flattenedArray = []) => {
array.forEach(element => {
if (Array.isArray(element)) {
@michaelhayman
michaelhayman / gist:fde975809c274df6e169
Created January 14, 2016 08:46
Recursive search and replace
find . -type f -name '*.rb' -exec sed -i '' s/flash/flash.now/ {} +
@michaelhayman
michaelhayman / gist:1d95d0b99bd9c887cace
Created September 22, 2014 14:40
Add local domains to Genymotion
Find adb (e.g. /Applications/android/sdk/platform-tools)
adb root
adb remount
adb push /etc/hosts /system/etc
Now you should be able to use local domain aliases in the simulator.
@michaelhayman
michaelhayman / gist:93a90e8e06b6a20217a6
Last active August 29, 2015 14:04
Command line magic

Find all files under current directory & open them in split vim windows:

find . -name '*.rb' -exec vim -O {} +

#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,