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
| log = require("./logger")("mrc:launcher:") | |
| if require.main == module | |
| file = process.argv[2] | |
| console.log "start", file | |
| target = require file | |
| process.on "message", (args) -> | |
| sendResponse = (status, data) -> | |
| process.send { status, data } | |
| process.exit(0) | |
| return target.apply(undefined, args).then (result) -> |
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
| debug = require "debug" | |
| debug.enable('mrc:*') | |
| module.exports = (prefix="", suffix=":") -> | |
| return { | |
| log: debug "#{prefix}log#{suffix}" | |
| debug: debug "#{prefix}debug#{suffix}" | |
| sql: debug "#{prefix}debug:sql#{suffix}" | |
| info: debug "#{prefix}info#{suffix}" | |
| error: debug "#{prefix}error#{suffix}" |
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
| DELETE FROM tablename | |
| WHERE id IN (SELECT id | |
| FROM (SELECT id, | |
| ROW_NUMBER() OVER (partition BY column1, column2, column3 ORDER BY id) AS rnum | |
| FROM tablename) t | |
| WHERE t.rnum > 1); |
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
| #!/usr/bin/env sh | |
| TEMPLATE_FILE=$1 | |
| ENV_PREFIX=$2 | |
| env | grep "^$ENV_PREFIX" | while IFS="=" read -r name value; do | |
| printf "s/%s/%q/\n" "${name}" "$value" | |
| done > sed-script.txt | |
| cat sed-script.txt # Optional | |
| sed -f sed-script.txt "$TEMPLATE_FILE" |
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 |
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
| 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
| <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
| #!/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
| $(".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"); |