Skip to content

Instantly share code, notes, and snippets.

View josegl's full-sized avatar
:octocat:

Jose G.L. josegl

:octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am josegl on github.
  • I am jgldev (https://keybase.io/jgldev) on keybase.
  • I have a public key ASBX-DOizz1LIMBRBanNLLSFxn0cVy0bkjRJa51L_2iIbAo

To claim this, I am signing this object:

'use strict';
var _cloneNode, _createElement, _isCanvasBlank, jsPDF, downloadPdf;
_cloneNode = function(node, javascriptEnabled) {
var child, clone;
clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);
child = node.firstChild;
while (child) {
if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') {
clone.appendChild(_cloneNode(child, javascriptEnabled));
'use strict';
var util = newUtil();
var inliner = newInliner();
var fontFaces = newFontFaces();
var images = newImages();
// Default impl options
var defaultOptions = {
// Default is to fail on error, no placeholder
@josegl
josegl / client.js
Created July 7, 2016 06:53
client route example
router.get('/', (req, res) => {
if(req.user){
if req.user.active){
if(req.query.id){
findById(req.query.id).then(fClient => {
if(fClient){
res.json(fClient);
} else {
res.json({});
}
@josegl
josegl / List.js
Created January 29, 2016 23:19
Container element class with lifecycle element hooks
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { fetchItemsIfNeeded } from './actions';
import ListItem from './ListItem';
class List extends Component{
constructor(props) {
super(props);
}
@josegl
josegl / List.js
Last active January 29, 2016 09:27
working example
import React from 'react';
export default ({
items, fetchItems
}) => {
if(items.size === 0)
fetchItems();
return (<div>{items}</div>);
};
@josegl
josegl / Input.js
Last active January 28, 2016 12:01
export default ({
value, update
}) => (¬
<div>
<input onChange={e => update(e.target.value) value={value}}/>
</div>¬
);
@josegl
josegl / LeftNav.js
Created January 28, 2016 11:30
Example of how containers should work in complex apps.
export default ({
selected_item, open, gotoIndex
}) => (¬
<List open={open} selected_item={selected_item}>¬
<ListItem value={1} onClick={e => gotoIndex(target.value)}/>¬
<ListItem value={2} onClick={e => gotoIndex(target.value)}/>¬
@josegl
josegl / font.sh
Created November 26, 2015 20:41
How to increase a java application GUI font from terminal
java -Dswing.aatext=true -Dswing.plaf.metal.controlFont=Tahoma-20 -Dswing.plaf.metal.userFont=Tahoma-20 -jar file.jar
@josegl
josegl / ItemListContainer.js
Last active November 18, 2015 10:21
Logic in an redux action?
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { fetchItemsIfNeeded } from '../actions';
import ListItem from '../components/ListItem';
class ItemsList extends Component {
constructor(props) {
super(props);
}