Skip to content

Instantly share code, notes, and snippets.

@elisechant
elisechant / app.js
Created January 28, 2018 22:02
React page transitions - Js Transition - react-transition-group v1, react router v4 (animate with JS)
import React from 'react';
import { Route } from "react-router-dom";
import TransitionGroup from "react-transition-group/TransitionGroup";
import TransitionedPage from './transitionedPage';
const HomePage = () => <div>Home</div>
const ContactPage = () => <div>Contact</div>
const firstChild = props => {
@elisechant
elisechant / app.js
Created January 28, 2018 22:01
React page transitions - CSS Transition - react-transition-group v1, react router v4
import React from 'react';
import { Route } from "react-router-dom";
import TransitionGroup from "react-transition-group/TransitionGroup";
import TransitionedPage from './transitionedPage';
const HomePage = () => <div>Home</div>
const ContactPage = () => <div>Contact</div>
const App = () => {
@elisechant
elisechant / index.js
Last active September 12, 2017 03:56
scaling-timeout.js
const RETRIES = 10;
[...Array(RETRIES).keys()].forEach(i => {
const timeout = Math.pow(2, i);
console.log(timeout);
});
@elisechant
elisechant / index.html
Last active July 31, 2016 07:40
Manifest quick start
<html>
<head>
// ...
<link rel="manifest" href="/manifest.webmanifest">
@elisechant
elisechant / resizable.js
Last active August 29, 2015 14:19
Element resize events
var Resizable = (function(window, $) {
'use strict';
function Resizable(el, options) {
this.el = el;
this.$el = $(el);
this.init();
return this;
@elisechant
elisechant / angular-data-service-layer_type-$http.js
Last active August 29, 2015 14:17
Angular $http CRUD operations with Factory Constructor model and data service
angular.module('app', [
'ngRoute'
]);
angular.module('app')
.constant('API_URL', '/api');
angular.module('app').config(function($routeProvider) {
$routeProvider
.when('/books', {
@elisechant
elisechant / angular-data-service-layer_type-$resource.js
Last active August 29, 2015 14:17
Angular $resource CRUD operations with Factory Constructor model and data service
angular.module('app', [
'ngRoute',
'ngResource'
]);
angular.module('app')
.constant('API_URL', '/api');
angular.module('app').config(function($routeProvider) {
$routeProvider
@elisechant
elisechant / index.html
Created March 8, 2015 07:22
Angular collection and item controllers
<!DOCTYPE html>
<html ng-app="app">
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="../bower_components/angular/angular.js"></script>
<script src="../bower_components/angular-route/angular-route.js"></script>
<script src="../bower_components/lodash/lodash.js"></script>
<script>
@elisechant
elisechant / Vagrantfile
Last active August 28, 2018 20:47
Vagrantfile for IE testing
# Usage: IE={box} vagrant up
#
# Eg. IE=XPIE6 vagrant up
boxes = {
"XPIE6" => "http://aka.ms/vagrant-xp-ie6",
"XPIE8" => "http://aka.ms/vagrant-xp-ie8",
"VistaIE7" => "http://aka.ms/vagrant-vista-ie7",
"Win7IE8" => "http://aka.ms/vagrant-win7-ie8",
"Win7IE9" => "http://aka.ms/vagrant-win7-ie9",
@elisechant
elisechant / app.js
Last active August 29, 2015 14:15
Angular parent-child controllers
angular.module('myApp', [
'ui.router'
]).config(function($stateProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$stateProvider
.state('home', {
url: '/',