Skip to content

Instantly share code, notes, and snippets.

Avatar

Dean S. dsacramone

  • Venice, California
View GitHub Profile
@getify
getify / 1.html
Last active Dec 21, 2022
Ever noticed how vw/vh units in CSS seem to be a bit unreliable on various devices (especially mobile)? Here's my solution.
View 1.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>Test Page</title>
<script>
// early compute the vw/vh units more reliably than CSS does itself
computeViewportDimensions();
@dispix
dispix / CHANGELOG.md
Last active Feb 15, 2021
OAUTH2 Authentication and token management with redux-saga
View CHANGELOG.md

Revision 5

  • Fix error parsing

Revision 4

  • Add missing yield in the login function

Revision 3

@iammerrick
iammerrick / PinchZoomPan.js
Last active Jan 12, 2023
React Pinch + Zoom + Pan
View PinchZoomPan.js
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;
@btroncone
btroncone / rxjs_operators_by_example.md
Last active Jan 23, 2023
RxJS 5 Operators By Example
View rxjs_operators_by_example.md
@Avaq
Avaq / combinators.js
Last active Jan 19, 2023
Common combinators in JavaScript
View combinators.js
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@tribou
tribou / webpack.config.js
Last active Mar 7, 2017
Including Babel.js and ESlint with Webpack
View webpack.config.js
// Webpack config file
var BrowserSyncPlugin = require('browser-sync-webpack-plugin');
module.exports = {
entry: './assets/js/components/Index.jsx',
output: {
path: __dirname + '/assets/js',
filename: 'bundle.js'
},
module: {
@vjpr
vjpr / README.md
Last active Feb 4, 2016 — forked from skevy/gist:8a4ffc3cfdaf5fd68739
Reduce boilerplate in Redux
View README.md

Reduce boilerplate in Redux

  • Create actions similar to Flummox.
  • Generate action ids.
  • Supports actions with promises, and therefore ES7 async.
@jhusain
jhusain / gist:4b14f5069f3a254cfa0a
Created Apr 19, 2015
Converting event to Observable
View gist:4b14f5069f3a254cfa0a
function fromEvent(dom, eventName) {
return {
forEach: function(observer) {
var handler = (e) => {
observer.onNext(e);
};
dom.addEventListener(eventName, handler);
// Subscription
return {
@allenwb
allenwb / 0Option2ConstructorSummary.md
Last active Mar 27, 2022
New ES6 constructor features and semantics: Alternative 2 manual super in derived classes
View 0Option2ConstructorSummary.md

New ES6 Constructor Semantics and Usage Examples

Manual super: Alternative Design where subclass constructors do not automatically call superclass constructors

This Gist presents a new design of class-based object construction in ES6 that does not require use of the two-phase @@create protocol.

One of the characteristics of this proposal is that subclass constructors must explicitly super invoke their superclass's constructor if they wish to use the base class' object allocation and initialization logic.

An alternative version of this design automatically invokes the base constructor in most situations.