Skip to content

Instantly share code, notes, and snippets.

View allthesignals's full-sized avatar
🥑
coding lotsa code

Matt Gardner allthesignals

🥑
coding lotsa code
View GitHub Profile
@allthesignals
allthesignals / controllers.application.js
Last active May 10, 2020 06:23 — forked from poteto/controllers.application.js
ember-changeset-validations demo
import Ember from 'ember';
import AdultValidations from '../validations/adult';
import ChildValidations from '../validations/child';
import { reservedEmails } from '../validators/uniqueness';
import { schema } from '../models/user';
const { get } = Ember;
const { keys } = Object;
export default Ember.Controller.extend({
@allthesignals
allthesignals / cloudSettings
Created October 18, 2018 17:53 — forked from buschtoens/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-10-18T14:27:42.834Z","extensionVersion":"v3.2.0"}
@allthesignals
allthesignals / gist:fe1892bcaaa2d01015efe24d9cc21192
Last active June 23, 2018 17:51 — forked from chriswhong/gist:762ceac7fb8a1420e7e7adceb770b707
Using ST_AsMVT() and ST_AsMVTGeom() in express to build a vector tile endpoint
/* GET /tiles/:z/:x/:y.mvt */
/* Retreive a vector tile by tileid */
router.get('/tiles/:z/:x/:y.mvt', async (req, res) => {
const { z, x, y } = req.params;
// calculate the bounding polygon for this tile
const bbox = mercator.bbox(x, y, z, false);
// Query the database, using ST_AsMVTGeom() to clip the geometries
// Wrap the whole query with ST_AsMVT(), which will create a protocol buffer
@allthesignals
allthesignals / type.js
Created November 21, 2017 17:32 — forked from kirilloid/type.js
getType
function getType (value) {
let type = typeof value;
if (type === 'object') {
return value ? Object.prototype.toString.call(value).slice(8, -1) : 'null';
}
return type;
}
[NaN, 0, 1, Infinity, // numbers
null, undefined, false, 'str', // other primitives
@allthesignals
allthesignals / .block
Last active October 31, 2017 20:48 — forked from shancarter/.block
Mister Nester
license: mit
height: 700
@allthesignals
allthesignals / README.md
Last active October 20, 2017 15:01
Ember Twiddle Demo: Mirage with Ember Twiddle

Ember Twiddle Demo: Mirage with Ember Twiddle

Demo

This is a very trivial example of using mirage with Ember Twiddle.

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
status: 'active'
});
import Ember from 'ember';
import QueryParams from 'ember-parachute';
export const myQueryParams = new QueryParams({
'qps.housingType': {
as: 'type',
defaultValue: 'single',
},
'qps.housing.developmentType': {
as: 'housing.developmentType',
@allthesignals
allthesignals / README-Template.md
Last active May 26, 2017 20:51 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Screenshots

image

Getting Started

@allthesignals
allthesignals / Open iterm tab here
Last active April 7, 2016 15:24 — forked from eric-hu/Open iterm tab here
Apple script to right click a CSV file to open it in an interactive python shell and load into a Pandas dataframe. To use:(1) Open Automator(2) Create a new service(3) Change "Service receives selected" drop downs to "Files or folders" in "Finder"(4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer: