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 zlib = require("zlib"); | |
const util = require("util"); | |
class Parser { | |
constructor(buf) { | |
this.pos = 0; | |
this.buf = buf; | |
this.last_position = { x: 0, y: 0 }; | |
} |
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
local mod_gui = require("mod-gui") | |
local current_player_index | |
local name_element | |
local tick_element | |
script.on_init(function() | |
current_player_index = 0 | |
end) | |
script.on_event(defines.events.on_player_joined_game, function(event) |
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
// ==UserScript== | |
// @name Dark Python 3 | |
// @namespace Hornwitser | |
// @include https://docs.python.org/3* | |
// @version 1 | |
// ==/UserScript== | |
// This is probably missing a few uncommon elements. | |
var rules = [` |
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
/* | |
* Hornwitser's silly calculator app v0.1 | |
*/ | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
#include <stdexcept> | |
#include <iostream> |
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 random | |
import time | |
class ExponentialBackoff: | |
"""An implementation of the exponential backoff algorithm | |
Provides a convenient interface to implement an exponential backoff | |
for reconnecting or retrying transmissions in a distributed network. | |
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
# Read the config file | |
config = eval(open('cfg.py').read()) | |
# Use it like any other dict | |
config['Hello'] = 'Modified World' | |
# Write the changed config file back | |
lines = [' {!r}: {!r},'.format(k, config[k]) for k in sorted(config)] | |
open('cfg.py', 'w').write('\n'.join(['# Modified config', '{']+lines+['}'])) |