Skip to content

Instantly share code, notes, and snippets.

🔥
chart you

Alexander Kukhta thers

🔥
chart you
Block or report user

Report or block thers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View unhasher.go
package main
import (
"fmt"
"time"
"bytes"
"strings"
"math/big"
"math/rand"
cryptoRand "crypto/rand"
View generic_texture_renderer_example.js
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);
View fixed-width-numbers.css
// via https://twitter.com/wesbos/status/932644812582522880
font-feature-settings: "tnum";
font-variant-numeric: tabular-nums;
View html-inline-css-loader.js
const inliner = require('inline-css');
module.exports = function (content) {
const callback = this.async();
inliner(content, {
url: `file:///${this.context}/`,
removeHtmlSelectors: true,
})
.then((html) => {
@thers
thers / latency.txt
Created Feb 14, 2017 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
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
View ffs.cs
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";
View goty_jsonp.js
function goty() {
return {
"2003": [
[
"Star Wars: Knights of the Old Republic",
18,
18,
0
],
[
@thers
thers / goty.json
Last active Jan 10, 2017
Game of the Year
View goty.json
{
"2003": [
[
"Star Wars: Knights of the Old Republic",
18,
18,
0
],
[
"The Legend of Zelda: The Wind Waker",
View wtf.html
<!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>
@thers
thers / BiasedRandom.js
Last active Dec 4, 2015
Biased random generator
View BiasedRandom.js
function boundrand (min, max) {
return min + (Math.random() * (max - min));
}
export default class BiasedRandom {
/**
* Ctor
*
* @example
You can’t perform that action at this time.