This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"id": "43917710-36f0-4e41-9767-786f744fb1bd", | |
"type": "containeroutlet", | |
"attributes": { | |
"position": 0, | |
"name": "Any Layout", | |
"is_searchable": false, | |
"help_text": "Any description for any layout", | |
"is_array": false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sample array | |
const rolling = [2, 4, 6, 8, 15]; | |
// Returns the average of an array of numeric values | |
function average(arr) { | |
// .reduce() with a simple callback creates the sum of all values inside the array | |
// dividing by the length of the array to get the average | |
return arr.reduce((a, b) => a + b) / arr.length; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const argv = require('minimist')(process.argv.slice(2)); | |
const readFileSync = require('fs').readFileSync; | |
const join = require('path').join; | |
const configFilePath = argv.config; | |
const config = JSON.parse(readFileSync(join(__dirname, '..', 'config.json'))); | |
if (configFilePath) { | |
// Read config file defined by param from disk | |
const configFile = readFileSync(configFilePath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
root: true, | |
parser: 'babel-eslint', | |
parserOptions: { | |
ecmaVersion: 6, | |
sourceType: 'module' | |
}, | |
extends: 'airbnb-base', | |
env: { | |
'node': true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'button', | |
result: 0, | |
click() { | |
this.set('result', Math.random()); | |
const result = this.get('result'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const { statSync, readFileSync, createReadStream } = require('fs'); | |
const { join, extname, basename } = require('path'); | |
const { networkInterfaces } = require('os'); | |
const port = 3000; | |
const cwd = join(__dirname, 'dist'); | |
const defaultFile = join(cwd, 'index.html'); | |
const maxAge = 24 * 3600; | |
const mimeTypes = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 13GbhHKSAZRByGrREAcsTZwsjXm6YW2AwG https://explorer.blockstack.org/address/13GbhHKSAZRByGrREAcsTZwsjXm6YW2AwG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension UIImage { | |
func edgeColor(_ insets: UIEdgeInsets = UIEdgeInsets(top: 10.0, left: 10.0, bottom: 10.0, right: 10.0), defaultColor: UIColor = .black) -> UIColor { | |
guard let pixelData = self.cgImage?.dataProvider?.data else { | |
return defaultColor | |
} | |
let data: UnsafePointer<UInt8> = CFDataGetBytePtr(pixelData) | |
let width = Int(self.size.width * self.scale) |