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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script data-main="usage" src="http://requirejs.org/docs/release/1.0.8/comments/require.js"></script> | |
</head> | |
<body> | |
<p>Check your JavaScript console for output!</p> | |
</body> | |
</head> |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" /> | |
<!-- when.js Promises implementation --> | |
<script src="https://raw.github.com/cujojs/when/master/when.js"></script> | |
<!-- Unit testing and mocking framework --> | |
<script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></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
import * as React from 'react'; | |
import * as GoogleWebAuth from 'expo-auth-session/providers/google'; | |
import * as GoogleAppAuth from "expo-google-app-auth"; | |
import * as WebBrowser from 'expo-web-browser'; | |
import * as AppAuth from 'expo-app-auth'; | |
import { Platform } from 'react-native'; | |
import Constants, {AppOwnership} from 'expo-constants'; | |
// Call this function once in your Component which handles the Google authentication | |
// flow; typically done outside of the component decleration (ie: just after your |
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
QUnit.module("my-module", | |
{ | |
setup: function () { | |
// Configure Sinon's FakeServer instance. `autoRespond` ensures that any incoming requests | |
// will automatically be replied to, otherwise you *must* invoke `this.server.respond` to | |
// start processing. | |
this.server = sinon.fakeServer.create(); | |
this.server.autoRespond = true; | |
// Tells the FakeServer's XHR request factory that we don't want to respond to every |
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
- Setup Google Compute Account | |
- Create micro-f1 instance | |
- SSH into instance (Debian/Jessy) | |
- Install apt-get deps from https://github.com/eugeneware/docker-wordpress-nginx | |
- install fail2ban (https://www.digitalocean.com/community/tutorials/how-to-protect-an-nginx-server-with-fail2ban-on-ubuntu-14-04) | |
- create a wordpress rule in jails.local | |
``` | |
[wordpress] | |
enabled = true | |
port = http,https |
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
export function fromObject<T extends jspb.Message, U>(c: new () => T, obj: U): T { | |
const instance = new c(); | |
Object.keys(obj) | |
.forEach(key => { | |
const setterName = makeSetterFuncName(key); | |
(instance as any)[setterName] = (obj as any)[key]; | |
}); | |
return instance; | |
} |
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
const Counter = props => { | |
const { count, dispatch } = props; | |
return ( | |
<div> | |
<p>Counter value: {props.value}</p> | |
<button onClick={() => dispatch({ type: 'INC' })}>++</button> | |
<button onClick={() => dispatch({ type: 'DEC' })}>--</button> | |
</div> | |
); | |
} |
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
FROM java:8-jre | |
RUN \ | |
useradd --home /home/node -m -U -s /bin/bash node && \ | |
apt-get update && \ | |
apt-get install -y --no-install-recommends git curl && \ | |
rm -rf /var/lib/apt/lists/ | |
USER node |
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
// Register a message handler for "some message" | |
messageBus.addHandler("some_message", function (message, next) { | |
// do something with the data in an async fashion | |
$.get(message.url, function () { | |
if (response.code !== 200) { | |
// Transition into an error state, terminates processing. | |
next(new Error("bad http request!")); | |
} | |
else { | |
// Modify the state of the object and pass execution to the next handler |
NewerOlder