View render.js
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 framesPerSecond = 30; | |
const frameTimer = 1000 / framesPerSecond; | |
const now = () => Date.now(); | |
let timer = null; | |
function render(previousDelta) { | |
const start = now(); | |
move(previousDelta); |
View mattermost.rb
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
# rubocop:disable Style/CaseEquality | |
# rubocop:disable Style/MultilineTernaryOperator | |
# rubocop:disable Style/NestedTernaryOperator | |
module Fastlane | |
module Actions | |
class MattermostAction < Action | |
def self.is_supported?(platform) | |
true | |
end |
View test-index.js
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
// Pre-load your MAGE app's configuration | |
const config = require('mage/lib/config'); | |
// Disable MMRP and service discovery during tests | |
config.set('server.serviceDiscovery', false) | |
config.set('server.mmrp', false) | |
// Load your MAGE app | |
const game = require('../lib'); |
View package.json
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
{ | |
"scripts": { | |
"show:config": "echo 'Show the compiled MAGE configuration' && mage show:config", | |
"archivist:create": "echo 'Create archivist vaults' && mage archivist:create", | |
"archivist:migrate": "echo 'Migrate archivist vaults' && mage archivist:migrate", | |
"archivist:drop": "echo 'Drop the archivist vaults' && mage archivist:drop" | |
} | |
} |
View index.js
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 net = require('net') | |
try { | |
net.createServer((args) => console.log(...args)).listen('hello', (error) => console.error('listen error', error)) | |
} catch (error) { | |
console.error('Uncaught listen error', error) | |
} |
View test-listen.sh
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
#!/usr/bin/env bash | |
function printResult() { | |
echo "" | |
echo "==============================" | |
[[ ${1} == 0 ]] && echo "success" || echo "failed" | |
echo "==============================" | |
} | |
# With this path, the file will be truncated to 'file.s' |
View test-listen.sh
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
#!/usr/bin/env bash | |
function printResult() { | |
echo "" | |
echo "==============================" | |
[[ ${1} == 0 ]] && echo "success" || echo "failed" | |
echo "==============================" | |
} | |
View GameState.ts
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
// module: | |
// createGame: create a game instance | |
// findGames: find all game instances across all game servers | |
// user commands: | |
// join: adds actor id to list, returns global game state | |
// quit: removes actor id | |
// makeMove: send data | |
import * as mage from 'mage' | |
import { networked, rpc, stream } from 'mage-parser' |
View app.js
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
try { | |
require('./bad-require') | |
} catch (error) { | |
console.error('first error:', error.message) | |
} | |
try { | |
require('./bad-require') | |
} catch (error) { | |
console.error('second error:', error.message) |
View usercommands-hello.ts
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 mage from 'mage' | |
import { Acl } from 'mage-validator' | |
import { IsInt, Max, ValidateNested } from 'class-validator'; | |
import PlayerData from '../types/PlayerData' | |
export default class { | |
@IsInt() | |
@Min(1) | |
public gemRegisterBonus: number |
NewerOlder