Cross-browser function to trigger DOM events.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let UserContext = React.createContext(); | |
class App extends React.Component { | |
state = { | |
user: null, | |
setUser: user => { | |
this.setState({ user }); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 🔥 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 | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 🔥 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 | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.FilteredRoute = Em.Route.extend({ | |
page: 1, | |
query: null, | |
model: function() { | |
return this.store.find('something', { | |
page: this.page, | |
query: this.query | |
}); | |
}, | |
actions: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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'); |
NewerOlder