Skip to content

Instantly share code, notes, and snippets.

@rfinni
rfinni / component.js
Created December 4, 2016 16:50
ReactCSSTransitionGroup example.
<ReactCSSTransitionGroup
component="div"
className="app-wrapper"
transitionName="app-transition"
transitionEnterTimeout={2000}
transitionAppear={true}
transitionAppearTimeout={2000}
transitionLeaveTimeout={2000}>
import React from "react";
import { render } from "react-dom";
const ParentComponent = React.createClass({
getDefaultProps: function() {
console.log("ParentComponent - getDefaultProps");
},
getInitialState: function() {
console.log("ParentComponent - getInitialState");
return { text: "" };
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active March 6, 2026 18:29
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});