This file contains hidden or 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 React from "react" | |
export default React.createClass({ | |
getInitialState() { | |
return { | |
displayState: "confimination", | |
} | |
}, | |
handleButtonClick(displayState) { | |
return () => { |
This file contains hidden or 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
<div id="clock"> | |
</div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js"></script> | |
<script> | |
setInterval(function() { | |
document.getElementById("clock").innerHTML = moment().format("YYYY/DD/MM HH:MM:ss"); | |
}) | |
</script> |
This file contains hidden or 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
function temp(test) { | |
if (test) { | |
return Promise.resolve("howdy"); | |
} else { | |
return fetch("/api").then((response) => { | |
return "lol"; | |
}); | |
} | |
} |
This file contains hidden or 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
function temp(test) { | |
if (test) { | |
return Promise.resolve("howdy"); | |
} else { | |
return fetch("/api").then((response) => { | |
return "lol"; | |
}); | |
} | |
} |
This file contains hidden or 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
$(".feature-tab-header").on("click", function() { | |
var targetTab = "." + $(this).attr("id"); | |
var targetHeader = this; | |
var promises = [ | |
$(".feature-tab.active").removeClass("active").promise(), | |
$(".feature-tab-header").removeClass("active").promise() | |
]; | |
return $.when(promises).done(function() { | |
$(targetHeader).addClass("active"); | |
$(targetTab).addClass("active"); |
This file contains hidden or 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
#!/bin/bash | |
if [ "$1" != "" ] && [ "$1" = "-h" ]; then | |
echo "Shipyard Deploy uses the following environment variables:" | |
echo " ACTION: this is the action to use (deploy, upgrade, node, remove)" | |
echo " DISCOVERY: discovery system used by Swarm (only if using 'node' action)" | |
echo " IMAGE: this overrides the default Shipyard image" | |
echo " PREFIX: prefix for container names" | |
echo " SHIPYARD_ARGS: these are passed to the Shipyard controller container as controller args" | |
echo " TLS_CERT_PATH: path to certs to enable TLS for Shipyard" |
This file contains hidden or 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
<scripts_config.xml checkPing="true" debugInfo="true"> | |
<space>spaces/ocean</space> | |
<offlineModel>PASD010_Fletcher_1942</offlineModel> | |
<player entityType="Avatar" startDirection="1.0 0.0 0.0" startPosition="0.0 0.0 -313.0"/> | |
<cursorScaleSpeed x="40" y="40"/> | |
<server online="true"> | |
<host addr="login.worldofwarships.jp:20020" alias="WOWS ASIA"/> | |
<host addr="login.worldofwarships.com:20020" alias="WOWS NA"/> | |
</server> | |
<chat visibleLines="6"/> |
This file contains hidden or 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
function rejectOn4(v) { | |
if (v === 4) { | |
throw "crash"; | |
} | |
} | |
function increment(v){ | |
return v++; | |
} |
This file contains hidden or 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
function demo(nmdb) { | |
return { | |
lol: () => { | |
return nmdb.get("blah"); | |
} | |
} | |
} | |
demo(nmdb).lol().then(() => { | |
console.log("done"); |
This file contains hidden or 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
// Babel 2015 - ES6 | |
// Convert a complex JS Object to GraphQL Query, should handle most use cases as of 21/01/2016 | |
const o = { | |
query: { | |
fields: { | |
complex: { | |
aliasFor: "Products", | |
processArgs: { | |
coupon: (value) => { | |
return `"${JSON.stringify(value).replace(/"/g, "\\\"")}"`; // passing json string as a argument |