Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Andrew Martin andrewmartin

View GitHub Profile
@andrewmartin
andrewmartin / contentful.js
Created Mar 5, 2018
contentful-api-endpoint-node
View contentful.js
const contentful = require('contentful');
const client = contentful.createClient({
space: '<space_id>',
accessToken: '<access_token>',
});
export default (req, res) => {
return client.getEntry({
content_type: 'page',
View pre-commit
#!/usr/bin/env bash
STAGED_FILES=$(git diff --name-only --cached --diff-filter=ACM -- *.jsx *.js)
# STAGED_FILES=$(git diff -- *.jsx --cached --name-only --diff-filter=ACM)
BIN_PATH="$(git rev-parse --show-toplevel)/node_modules/.bin"
eslint() {
ESLINT="$BIN_PATH/eslint"
# Check for eslint
View init.coffee
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@andrewmartin
andrewmartin / post-receive
Last active Sep 12, 2017
post-receive hook for pm2
View post-receive
#!/usr/bin/env bash
# start your app first; pm2 start ./build/server.js --name app-name
# then, place in repo.git/hooks/post-receive
# and set permissions:
# chmod +x hooks/post-receive
set -u
set -e
View .csscomb.json
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "upper",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": false,
"quotes": "double",
View .csscomb.json
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "upper",
"block-indent": " ",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
@andrewmartin
andrewmartin / cloudSettings
Last active Jan 20, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-01-20T23:04:39.991Z","extensionVersion":"v3.2.4"}
View env.js
exports.config = {
api: "api.catalogs.com",
root: "http://shopii.catalogs.com",
port: 1234,
fb: {
appId: '246541675489369'
},
environment: 'development'
};
View Gruntfile.coffee
'use strict'
module.exports = (grunt) ->
path = require('path')
# load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks
require('time-grunt')(grunt)
# config
grunt.initConfig
View wordpress-sample.html
<strong class="style-label">Headings</strong>
<h1>Header one</h1>
<h2>Header two</h2>
<h3>Header three</h3>
<h4>Header four</h4>
<h5>Header five</h5>
<h6>Header six</h6>
<strong class="style-label">Blockquotes</strong class="style-label">
Single line blockquote:
<blockquote>Stay hungry. Stay foolish.</blockquote>
You can’t perform that action at this time.