Skip to content

Instantly share code, notes, and snippets.

View poteto's full-sized avatar
🥔
ポテト

lauren poteto

🥔
ポテト
View GitHub Profile
@OliverJAsh
OliverJAsh / README.md
Last active September 14, 2018 06:45
FP list combinators demo with fp-ts
tsc && node main.js
@chrsstrm
chrsstrm / gas_sheet_as_json.js
Last active June 9, 2023 10:38
Treat a Google Sheet like a JSON API
/**
* create a Google Sheet then go to Tools > Script Editor
* Paste this code into the editor. Save.
* Publish > Deploy as Web App
* Set new version, publish as me, who has access - anyone, even anon.
* GET to the URL, add on end ?sheet=[sheet name]
* Sheet name is the sheet name, manage appropriately (no spaces or symbols to keep it simple)
* Request returns JSON representation of the sheet.
*/
@adamkl
adamkl / regen-domain-types.js
Last active September 28, 2022 15:04
Generating typescript definitions from .graphql files using apollo-codegen and graphql-code-generator
const { introspectSchema } = require("apollo-codegen");
const { executeWithOptions } = require("graphql-code-generator/dist/cli");
const fs = require("fs");
const path = require("path");
const graphqlPath = "./src/graphql/";
const schemaInput = "./src/graphql/temp.graphql";
const jsonOutput = "./src/graphql/temp.json";
const dtsOutput = "./src/graphql/domain.d.ts";
@paulirish
paulirish / what-forces-layout.md
Last active April 23, 2024 15:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@samselikoff
samselikoff / future-proof.md
Last active April 21, 2023 17:14
Future-proofing your Ember 1.x code

This post is also on my blog, since Gist doesn't support @ notifications.


Components are taking center stage in Ember 2.0. Here are some things you can do today to make the transition as smooth as possible:

  • Use Ember CLI
  • In general, replace views + controllers with components
  • Only use controllers at the top-level for receiving data from the route, and use Ember.Controller instead of Ember.ArrayController or Ember.ObjectController
  • Fetch data in your route, and set it as normal properties on your top-level controller. Export an Ember.Controller, otherwise a proxy will be generated. You can use Ember.RSVP.hash to simulate setting normal props on your controller.
@mattes
mattes / call
Last active December 29, 2020 09:49
Place a call from terminal using your iPhone (Mac OS X Yosemite & iOS 8)
#!/usr/bin/env sh
open "tel://$*"
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@jlongster
jlongster / bloop.js
Last active September 5, 2022 23:33
bloop
(function() {
// Do not use this library. This is just a fun example to prove a
// point.
var Bloop = window.Bloop = {};
var mountId = 0;
function newMountId() {
return mountId++;
}