Skip to content

Instantly share code, notes, and snippets.

View thers's full-sized avatar
🔥
chart you

Aleksandr Kukhta thers

🔥
chart you
View GitHub Profile
<?php
/**
* This file is a part of something wonderful :)
*
* @author: RiderSx alexridersx[at]gmail.com
* @file: Phonetic.php
*/
function dmword($string, $is_cyrillic = true) {
static $codes = array(
package main
import (
"fmt"
"time"
"bytes"
"strings"
"math/big"
"math/rand"
cryptoRand "crypto/rand"
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);
// via https://twitter.com/wesbos/status/932644812582522880
font-feature-settings: "tnum";
font-variant-numeric: tabular-nums;
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 February 14, 2017 09:52 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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
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";
function goty() {
return {
"2003": [
[
"Star Wars: Knights of the Old Republic",
18,
18,
0
],
[
@thers
thers / goty.json
Last active January 10, 2017 20:42
Game of the Year
{
"2003": [
[
"Star Wars: Knights of the Old Republic",
18,
18,
0
],
[
"The Legend of Zelda: The Wind Waker",
<!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>