Skip to content

Instantly share code, notes, and snippets.

View chrisjlee's full-sized avatar
💭
🏈

Chris J. Lee chrisjlee

💭
🏈
View GitHub Profile
let UserContext = React.createContext();
class App extends React.Component {
state = {
user: null,
setUser: user => {
this.setState({ user });
}
};
@chrisjlee
chrisjlee / async-await.js
Created December 15, 2017 02:04 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@chrisjlee
chrisjlee / async-await.js
Created December 15, 2017 02:04 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@chrisjlee
chrisjlee / phprc
Created August 7, 2016 05:46 — forked from amnuts/phprc
Dreamhost PHP 5.6 phprc file
date.timezone = "Europe/London"
expose_php = 0
extension = phar.so
extension = fileinfo.so
extension = intl.so
suhosin.executor.include.whitelist = phar
[opcache]
zend_extension=opcache.so
// Define gulp before we start
var gulp = require('gulp');
// Define Sass and the autoprefixer
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
// This is an object which defines paths for the styles.
// Can add paths for javascript or images for example
// The folder, files to look for and destination are all required for sass
# Based on https://github.com/sass/libsass/wiki/Building-with-autotools
# Install dependencies
apt-get install automake libtool
# Fetch sources
git clone https://github.com/sass/libsass.git
git clone https://github.com/sass/sassc.git libsass/sassc
# Create configure script
<apex:page applyBodyTag="false" docType="html-5.0" applyHtmlTag="false" standardStylesheets="false" sidebar="false" showheader="false">
<html ng-app="restApiApp" >
<head>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"/>
</head>
<body ng-controller="MainCtrl">
<h1>Test REST API from JavaScript with AngularJS</h1>
<div ng-init="sessionId='{!$Api.Session_ID}'; url='/services/data/v30.0/query?q=SELECT+Name+FROM+Account+LIMIT+10'">
<input id="query" size="120" value="{{url}}" ng-model="url"/>
<button ng-click="submit()">Submit</button>
@chrisjlee
chrisjlee / route.js
Created August 18, 2014 16:31 — forked from alexspeller/route.coffee
Filter route example with pagination
App.FilteredRoute = Em.Route.extend({
page: 1,
query: null,
model: function() {
return this.store.find('something', {
page: this.page,
query: this.query
});
},
actions: {

triggerEvent

Cross-browser function to trigger DOM events.

"use strict";
/* global console */
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('gulp-browserify');
var jshint = require('gulp-jshint');
var watch = require('gulp-watch');
var stylish = require('jshint-stylish');
var refresh = require('gulp-livereload');
var sass = require('gulp-sass');