Skip to content

Instantly share code, notes, and snippets.

View parkerproject's full-sized avatar

Parker parkerproject

View GitHub Profile
@parkerproject
parkerproject / article.html
Created May 16, 2017 16:08 — forked from letanure/article.html
Social Media Tag Template
<!-- Place this data between the <head> tags of your website -->
<title>Page Title. Maximum length 60-70 characters</title>
<meta name="description" content="Page description. No longer than 155 characters." />
<!-- Twitter Card data -->
<meta name="twitter:card" value="summary">
<!-- Open Graph data -->
<meta property="og:title" content="Title Here" />
<meta property="og:type" content="article" />
@parkerproject
parkerproject / article.html
Created May 16, 2017 16:08 — forked from letanure/article.html
Social Media Tag Template
<!-- Place this data between the <head> tags of your website -->
<title>Page Title. Maximum length 60-70 characters</title>
<meta name="description" content="Page description. No longer than 155 characters." />
<!-- Twitter Card data -->
<meta name="twitter:card" value="summary">
<!-- Open Graph data -->
<meta property="og:title" content="Title Here" />
<meta property="og:type" content="article" />
@parkerproject
parkerproject / Gulpfile.js
Created April 7, 2017 18:17 — forked from auser/Gulpfile.js
The hack of the hackity hack
const gulp = require('gulp');
const plumber = require('gulp-plumber');
// css
const postcss = require('gulp-postcss');
// HACK
const concat = require('gulp-concat')
const inject = require('gulp-inject-string')
@parkerproject
parkerproject / styles.less
Created March 13, 2017 18:01 — forked from brandondurham/styles.less
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
@parkerproject
parkerproject / InfiniteWrapper.js
Created March 6, 2017 19:08 — forked from srph/InfiniteWrapper.js
react.js: a high-order component for infinite / load-more lists
import React, {PropTypes} from 'react';
import axios from 'axios';
/**
* @usage
* const InfinitePostsView = makeInfinite('/posts')(PostsView);
*/
const infinitePropType = PropTypes.shape({
data: PropTypes.array.isRequired,
@parkerproject
parkerproject / lopmonhoc.js.jsx
Created March 2, 2017 15:47 — forked from revskill10/lopmonhoc.js.jsx
Integrate Datatable with React.js
/** @jsx React.DOM */
var LopMonHoc = React.createClass({
getInitialState: function(){
return {data: []}
},
loadData: function(){
$.ajax({
url: '/daotao/lops',
success: function(data){
@parkerproject
parkerproject / index.html
Created February 16, 2017 02:17 — forked from puf/index.html
Zero to App: Develop with Firebase (for Web - Google I/O 2016)
<html>
<head>
<script src="https://www.gstatic.com/firebasejs/3.0.0/firebase.js"></script>
<title>ZeroToApp</title>
<style>
#messages { width: 40em; border: 1px solid grey; min-height: 20em; }
#messages img { max-width: 240px; max-height: 160px; display: block; }
#header { position: fixed; top: 0; background-color: white; }
.push { margin-bottom: 2em; }
@keyframes yellow-fade { 0% {background: #f2f2b8;} 100% {background: none;} }
@parkerproject
parkerproject / infinitelist-onrender.js
Created February 6, 2017 18:33 — forked from viviancromwell/infinitelist-onrender.js
Infinite List with React Native (OnRender: How to rerender the Infinite Scroll Widget)
updateRenderModel(contentOffset) {
var listItemHeight = ITEM_SIZE;
// Use contentOffset to calculate first visible dataItem as y-position / height of item
var firstVisibleItem = Math.max(0, Math.floor(contentOffset.y / listItemHeight));
var renderModelSize = BUFFER_ITEMS * 2 + DISPLAY_ITEMS;
// Calculate first y-position
var nextPosition = (firstVisibleItem - BUFFER_ITEMS) * listItemHeight;
// Subset of dataModel to be rendered.
var dataItems = this.state.dataModel.slice(firstVisibleItem, firstVisibleItem + renderModelSize);
var newRenderModel = dataItems.map((dataItem, index) => {