Skip to content

Instantly share code, notes, and snippets.

View zackshapiro's full-sized avatar

Zack Shapiro zackshapiro

View GitHub Profile
me {
firstName
lastName
location {
city
state
}
avatar {
large
}
interface Avatar {
thumbnail: string;
large: string;
}
interface User {
id: number;
firstName: string;
lastName: string;
avatar: Avatar;
{
"id": 12345,
"firstName": "Bryan",
"lastName": "Irace",
"avatar": {
"thumbnail": "https://some/s3/url/a39d39fk",
"large": "https://some/s3/url/39fka39d"
},
"profession": "Software developer",
"location": {
rgb.forEach((color, i) => {
var slider = d3
.sliderBottom()
.min(0)
.max(255)
.step(1)
.width(300)
.ticks(0)
.default(rgb[i])
.displayValue(false)
var gColorPicker = d3
.select('div#slider-color-picker')
.append('svg')
.attr('width', 375)
.attr('height', 200)
.append('g')
.attr('transform', 'translate(30,30)');
var num2hex = rgb => {
return rgb
.map(color => {
let str = color.toString(16);
if (str.length === 1) {
str = '0' + str;
}
return str;
})
.join('');
var blob = document.getElementById('blob');
var colorSlider = document.getElementById('slider-color-picker');
<!DOCTYPE html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Slider Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
@zackshapiro
zackshapiro / index.js
Last active March 3, 2023 10:06
Parse Separate Live Query Server Setup
// This is the index.js file for my Parse Live Query Server, running on a separate EC2 instance
var express = require('express');
var cors = require('cors')
var ParseServer = require('parse-server').ParseServer;
var app = express();
app.use(cors());
// We include the lines below so that we can hit `/` and it passes the Elastic Beanstalk Health Check
@zackshapiro
zackshapiro / index.js
Last active February 5, 2019 23:06
Single Server Live Query Setup
// This is the index.js file for my main app
var express = require('express');
var cors = require('cors')
var ParseServer = require('parse-server').ParseServer;
var path = require('path');
var bodyParser = require('body-parser');
var databaseUri = process.env.DATABASE_URI || process.env.MONGODB_URI;