Skip to content

Instantly share code, notes, and snippets.

Avatar
😈
Up to no good, probably.

Victoria French victoriafrench

😈
Up to no good, probably.
View GitHub Profile
View sample.js
import React, { useState, useEffect, useMemo, useCallback } from 'react';
const Student = ({ id, name, onChange }) => {
const handleOnChange = useCallback((event) => {
if (typeof onChange === 'function') {
onChange(id, event.target.value);
}
}, [id, onChange]);
View InlineEditing.js
el.set('contentEditable', true)
.addEvents({
keydown: function(e){ if (e.key == 'enter') e.preventDefault(); },
keypress: function(e){ if (e.event.which == 0 && e.code == 13) e.preventDefault(); },
blur: function(){ var text = this.get('text'); this.set('text', text); }
});
View gist:68c0b134918d6aa58280f9d41d4d97fc
# List users by average and maximum session length.
SELECT person, max(client.runtime_ms), avg(client.runtime_ms)
FROM item_occurrence
GROUP BY 1
ORDER BY 2 DESC
# List active date ranges for each deploy.
SELECT client.javascript.code_version, min(timestamp), max(timestamp)
FROM item_occurrence
GROUP BY 1
@victoriafrench
victoriafrench / asyncToReact.js
Created Sep 13, 2017 — forked from sebmarkbage/asyncToReact.js
Convert Async Function to React Component
View asyncToReact.js
function asyncToReact(fn) {
class PromiseComponent extends React.Component {
state = { waiting: true, result: null };
componentDidMount() {
fn(...this.props.args).then(result => this.setState({ waiting: false, result }));
}
componentDidUpdate() {
fn(...this.props.args).then(result => this.setState({ waiting: false, result }));
}
shouldComponentUpdate(newProps) {
@victoriafrench
victoriafrench / Enhance.js
Created Sep 13, 2017 — forked from sebmarkbage/Enhance.js
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@victoriafrench
victoriafrench / JavascriptModulePatterns
Created Jun 3, 2016 — forked from ShMcK/JavascriptModulePatterns
Javascript (ES5) Module Patterns
View JavascriptModulePatterns
'use strict';
// 1. Revealing Module Pattern
var revModule = function (param) {
return {
// public
funk: funk
};
// private
View defunctr-cla
**Individual Contributor License Agreement v3.0**
Thank you for Your interest in the Defunctr Open Source Project. This document clarifies the terms under which You, the person listed below, may make Contributions — which may include without limitation, software, bug fixes, configuration changes, documentation, art work, creative design, video, or any other materials — to any of the projects owned or managed by Cinecove Digital.
[Please complete information about You and the Contributions](#void). If You have questions about these terms, please contact us at [legal@cinecove.com](mailto:legal@cinecove.com).
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Defunctr Open Source Project. Except for the license granted herein to the Defunctr Open Source Project, You reserve all right, title, and interest in and to Your Contributions.
**Licenses**
@victoriafrench
victoriafrench / SAP_CLA
Created Mar 19, 2016 — forked from CLAassistant/SAP_CLA
SAP Individual Contributor License Agreement
View SAP_CLA
###SAP Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by SAP SE or its affiliates (“SAP”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to SAP in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact opensource@sap.com.
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to SAP a non-exclusive, perpetual, irrevocable, worldwid
View thunderflurry-cla.md

Individual Contributor License Agreement v3.1

Thank you for Your interest in the ThunderFlurry Foundation. This document clarifies the terms under which You, the person listed below, may make Contributions — which may include without limitation, software, bug fixes, configuration changes, documentation, art work, creative design, video, or any other materials — to any of the projects owned or managed by the ThunderFlurry Foundation.

Please complete information about You and the Contributions. If You have questions about these terms, please contact us at legal@cinecove.com.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the ThunderFlurry Foundation. Except for the license granted herein to the ThunderFlurry Foundation, You reserve all right, title, and interest in and to Your Contributions.

Licenses

View log
// usage: log('inside coolFunc', this, arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments);
arguments.callee = arguments.callee.caller;
if(this.console) console.log( Array.prototype.slice.call(arguments) );
};
You can’t perform that action at this time.