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
#!/bin/bash | |
### NOTE ### You probably don't need this anymore! | |
# Just set RUST_BACKTRACE=1 | |
# Usage: rust-backtrace ./my-rust-prog args... | |
exec gdb -batch -n -x /dev/fd/3 --args "$@" 3<<ENDGDB | |
set height 0 | |
set breakpoint pending on |
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 Promise from 'bluebird' | |
import MongoDB from 'mongodb' | |
Promise.promisifyAll(MongoDB) | |
async function findEveryone(db) { | |
const people = db.collection('people') | |
const everyone = await people.find().toArrayAsync() | |
return everyone.map( x => x.name ) | |
} |
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
function parseArguments() | |
{ | |
array_shift($argv); | |
$out = array(); | |
foreach($argv as $arg) | |
{ | |
if(substr($arg, 0, 2) == '--') | |
{ | |
$eqPos = strpos($arg, '='); | |
if($eqPos === false) |
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
declare var Game: screeps.IGame; | |
declare module screeps { | |
export interface IGame { | |
cpuLimit: number; | |
creeps: { [screepName: string]: ICreep }; | |
flags: { [flagName: string]: IFlag }; | |
map: IMap; | |
rooms: { [roomName: string]: IRoom }; |
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
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x86 | |
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x64 |
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
// Add a new function to player sandbox space | |
// Some Super Secret Secret (32 character hex string) | |
const secret = Buffer.from('DEADBEEF000000000000000000000000', 'hex') | |
const jwt = require('./lib/jwt') | |
module.exports = function (config) { | |
if (config.engine) { | |
config.engine.onPlayerSandbox = function (sandbox) { | |
sandbox.getAPIToken = function () { | |
let key = generateToken(sandbox.module.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
<?php | |
/** | |
* This code will benchmark your server to determine how high of a cost you can | |
* afford. You want to set the highest cost that you can without slowing down | |
* you server too much. 8-10 is a good baseline, and more is good if your servers | |
* are fast enough. The code below aims for ≤ 50 milliseconds stretching time, | |
* which is a good baseline for systems handling interactive logins. | |
*/ | |
function_exists('password_hash') or die("Please use PHP 5.5.0 or higher."); |
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
table { display: table } | |
tr { display: table-row } | |
thead { display: table-header-group } | |
tbody { display: table-row-group } | |
tfoot { display: table-footer-group } | |
col { display: table-column } | |
colgroup { display: table-column-group } | |
td, th { display: table-cell } | |
caption { display: table-caption } |
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
(def digits | |
(seq (str "0123456789" | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
"abcdefghijklmnopqrstuvwxyz" | |
".-_~"))) | |
(def radix (count digits)) | |
(defn encode | |
"Encodes Long to String." |
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'; | |
import React from 'react'; | |
export default class Clearfix extends React.Component { | |
render() { | |
const beforeStyle = { | |
display: 'table' | |
}; |
OlderNewer