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
package main | |
import ( | |
"fmt" | |
"time" | |
"bytes" | |
"strings" | |
"math/big" | |
"math/rand" | |
cryptoRand "crypto/rand" |
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
async function loadScaleform(scaleform) { | |
let scaleformHandle = RequestScaleformMovie(scaleform); | |
return new Promise(resolve => { | |
const interval = setInterval(() => { | |
if (HasScaleformMovieLoaded(scaleformHandle)) { | |
clearInterval(interval); | |
resolve(scaleformHandle); | |
} else { | |
scaleformHandle = RequestScaleformMovie(scaleform); |
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
// via https://twitter.com/wesbos/status/932644812582522880 | |
font-feature-settings: "tnum"; | |
font-variant-numeric: tabular-nums; |
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
const inliner = require('inline-css'); | |
module.exports = function (content) { | |
const callback = this.async(); | |
inliner(content, { | |
url: `file:///${this.context}/`, | |
removeHtmlSelectors: true, | |
}) | |
.then((html) => { |
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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
var missionMarker = new Scaleform("mp_mission_name_freemode"); | |
if (missionMarker.IsLoaded == false) { | |
Debug.WriteLine("SF not loaded"); | |
return; | |
} | |
var name = "Unique name"; | |
var type = "Some cool mission type"; | |
var playerInfo = "Player info"; |
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 goty() { | |
return { | |
"2003": [ | |
[ | |
"Star Wars: Knights of the Old Republic", | |
18, | |
18, | |
0 | |
], | |
[ |
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
{ | |
"2003": [ | |
[ | |
"Star Wars: Knights of the Old Republic", | |
18, | |
18, | |
0 | |
], | |
[ | |
"The Legend of Zelda: The Wind Waker", |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<style> |
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 boundrand (min, max) { | |
return min + (Math.random() * (max - min)); | |
} | |
export default class BiasedRandom { | |
/** | |
* Ctor | |
* | |
* @example |
NewerOlder