Skip to content

Instantly share code, notes, and snippets.

View vagusX's full-sized avatar
🎯
Focusing

vagusX vagusX

🎯
Focusing
View GitHub Profile
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@vagusX
vagusX / gist:b9b6fb9b3cc3e07a1a69
Created December 15, 2015 02:40 — forked from liamcurry/gist:2597326
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@vagusX
vagusX / export default Checkbox
Last active December 15, 2015 13:36
log about jest
Running 1 test suite...Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).
FAIL __tests__/checkbox-test.js (0.723s)
● Checkbox › it changes the text after click
- Error: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
at invariant (node_modules/react/node_modules/fbjs/lib/inva
@vagusX
vagusX / springer-free-maths-books.md
Created December 30, 2015 05:30 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@vagusX
vagusX / webpack.js
Created January 2, 2016 13:33 — forked from Couto/webpack.js
Fetch polyfill with webpack
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

import React from 'react';
console.log( 'React:', React );
@vagusX
vagusX / index.html
Last active January 20, 2016 08:25
rollup bundle react
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Rock Roll</title>
</head>
<body>
<div id='root'></div>
<script src='./build/bundle.js'></script>
</body>
@vagusX
vagusX / new-card.vue
Created January 27, 2016 14:22
news-list
<template>
<a v-link="{ path: '/news-detail/12345' }" class="card">
<div class="title">{{title}}</div>
<div class="img"></div>
<div class="brief">{{brief}}</div>
<div class="info">
<div class="category">{{category}}</div>
<div class="origin">{{origin}}</div>
<div class="time">{{time}}</div>
</div>
import babel from 'rollup-plugin-babel'
import uglify from 'rollup-plugin-uglify'
import npm from 'rollup-plugin-npm'
import commonjs from 'rollup-plugin-commonjs'
import replace from 'rollup-plugin-replace'
import json from 'rollup-plugin-json'
import inject from 'rollup-plugin-inject'
import postcss from 'rollup-plugin-postcss'
import autoprefixer from 'autoprefixer'