Skip to content

Instantly share code, notes, and snippets.

View dandigangi's full-sized avatar
♾️
def save_the_world

Dan DiGangi dandigangi

♾️
def save_the_world
View GitHub Profile
@dandigangi
dandigangi / squarespace-custom.css
Created October 10, 2021 17:43
Squarespace - Center Gallery Text Captions
.gallery-grid-wrapper p.gallery-caption-content {
text-align: center;
}
@dandigangi
dandigangi / functions.js
Last active September 23, 2018 18:53
Javascript ES5 vs ES6 Functions
// Expanding on a conversation about being terse with ES5 and ES6 functions on Twitter w/ @podrazque
// Being terse isn't inherently bad but it is important to think about how other developers will infer and understand what was written.
//////
// Example of a terse, one line function using a ES6 fx expression w/ arrows and a implicit return.
const objToArray = (data) => Object.keys(data).map((key) => data[key])
// See below for overview of some different function usage w/ ES5 & ES6
const magic = 'poof';
// Babel Deps
"@babel/core": "7.1.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "7.1.0",
"@babel/preset-react": "7.0.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "8.0.1",
"babel-jest": "23.6.0",
(function ( define ) {
'use strict';
define([], function () {
var RequestService = function ( $http, $q ) {
// Return dummy data for now
return {