Skip to content

Instantly share code, notes, and snippets.

View tylerbuchea's full-sized avatar
💭
Hello World!

Tyler tylerbuchea

💭
Hello World!
View GitHub Profile
@tylerbuchea
tylerbuchea / Enhance.js
Created December 15, 2015 22:44 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@tylerbuchea
tylerbuchea / README.md
Created December 6, 2015 20:29 — forked from mbostock/.block
Twitter SVG Logo
@tylerbuchea
tylerbuchea / gist:54f439eaf6cd729de62f
Created November 30, 2015 19:41 — forked from lsauer/gist:2907369
Google Chrome special pages for memory, debug, resources, profiling, downloads...

####lsauer.com


###Overview of all chrome:// pages.

  • List by calling chrome://about/
  • Following is a direct dump from the 'about' page for reference

###List of Pages as per v20.xxx

/**
* ================== angular-ios9-uiwebview.patch.js v1.1.0 ==================
*
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
*
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
*
* To apply this patch load/bundle this file with your application and add a
// Console arguments testing
var apc = [].slice;
(function(){
console.log( apc.call(arguments) );
})( "false", 1, undefined, null, ["foo","bar","baz"], {a:1,b:2}, false );
(function(){
console.log.call( console, apc.call(arguments) );
@tylerbuchea
tylerbuchea / pubsub-simple.js
Last active August 29, 2015 14:27 — forked from fatihacet/pubsub-simple.js
Simple PubSub implementation with JavaScript - taken from Addy Osmani's design patterns book -
var pubsub = {};
(function(q) {
var topics = {}, subUid = -1;
q.subscribe = function(topic, func) {
if (!topics[topic]) {
topics[topic] = [];
}
var token = (++subUid).toString();
topics[topic].push({
token: token,
@tylerbuchea
tylerbuchea / svg2png.js
Last active August 29, 2015 14:26 — forked from gustavohenke/svg2png.js
SVG to PNG
var svg = document.querySelector( "svg" );
var svgData = new XMLSerializer().serializeToString( svg );
var canvas = document.createElement( "canvas" );
var ctx = canvas.getContext( "2d" );
var img = document.createElement( "img" );
img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) );
img.onload = function() {
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
= IMAGEMAGICK
Working with images, PDFs and the command line
# convert from one format to another
convert image.gif image.jpg
# convert specific PDF page to image
/**
* @providesModule TappyButtonApp
* @flow
*/
'use strict';
var React = require('react-native/addons');
var {
Bundler,
StyleSheet,