Skip to content

Instantly share code, notes, and snippets.

View mattlo's full-sized avatar
🎯
Focusing

Matt Lo mattlo

🎯
Focusing
View GitHub Profile
@mattlo
mattlo / CardCvc.jsx
Created March 4, 2016 05:17
React Bare Credit Card Form
import React from 'react';
export default class CardCvc extends React.Component {
static propTypes = {
onChange: React.PropTypes.func.isRequired,
value: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
]).isRequired
};
@mattlo
mattlo / example2.js
Last active January 18, 2016 22:00
React examples on event handlers
class Cmp {
nextHandler = () => {
SomeAction.next(this.props.number)
};
render() {
return (
<a onClick={this.nextHandler}>Increment</a>
);
}
}
@mattlo
mattlo / gist:4b0ed74a9237af123cdd
Last active October 13, 2015 19:41
git tag diff
git log release/v0.2.2...release/v0.2.0 --reverse --pretty=format:"%h - %s - %cn" | cat - <(printf "\n")
@mattlo
mattlo / task.md
Created August 20, 2015 19:41
task1

Have an application that converts the following JavaScript into the HTML result. Use AngularJS to achieve your goal. input is used to reference but isn't necessary for your code. PAY ATTENTION TO DETAILS.

Input

var input = "Party like its 2015";

Output

@mattlo
mattlo / gist:4ac99895c64f2b6e1d73
Created August 3, 2015 20:08
AEM demo archetype
mvn archetype:generate \
-DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ \
-DarchetypeGroupId=com.day.jcr.vault \
-DarchetypeArtifactId=multimodule-content-package-archetype \
-DarchetypeVersion=1.0.2 \
-DgroupId=aem-demo \
-DartifactId=aemdemo \
-Dversion=0.0.1-SNAPSHOT \
-Dpackage=com.aemdemo \
-DappsFolderName=aem-demo \

html test

@mattlo
mattlo / sql.js
Last active August 29, 2015 14:25
let mysql = require('mysql');
let Q = require('q');
let sql = {};
// helps find :VARIABLEs
let PARAMETER_QUERY_REGEXP = /:([\w.$]+|"[^"]+"|'[^']+')/g;
/**
* Replaces paramters
* @param {String} q
#!/bin/bash
#
# This script configures the start information for this server.
#
# The following variables may be used to override the defaults.
# For one-time overrides the variable can be set as part of the command-line; e.g.,
#
# % CQ_PORT=1234 ./start
#
@mattlo
mattlo / setup.sh
Created February 11, 2015 18:31
docker/fig ubuntu
sudo apt-get update && sudo apt-get install -y build-essential curl dkms linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\
> /etc/apt/sources.list.d/docker.list"
sudo apt-get update && sudo apt-get install -y lxc-docker
curl -L https://github.com/docker/fig/releases/download/1.0.1/fig-`uname -s`-`uname -m` > /usr/local/bin/fig; chmod +x /usr/local/bin/fig
echo "Done"
maestro.common.ng.factory('transformers', [function () {
function getValueByDotPath(path, obj) {
return [obj]
.concat(path.split('.'))
.reduce(function (ref, property) {
return ref[property];
});
}