Skip to content

Instantly share code, notes, and snippets.

View Electroid's full-sized avatar

Ashcon Partovi Electroid

  • San Francisco
  • 23:19 (UTC -07:00)
View GitHub Profile
@Electroid
Electroid / benchmark-1-isbot.mjs
Last active January 4, 2024 01:53
The RegExp challenge
// Benchmark #1 - `isbot` tests
//
// Relevant issues:
// - https://github.com/oven-sh/bun/issues/5197
// Relevant credit:
// - https://github.com/strager for writing this benchmark
// - https://www.npmjs.com/package/isbot for `isbot`
import { run, bench } from "mitata";
import { gunzipSync } from "node:zlib";
@Electroid
Electroid / rollup.config.js
Created February 12, 2021 23:45
Rollup config for ESM Cloudflare Workers
import commonjs from '@rollup/plugin-commonjs'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import json from '@rollup/plugin-json'
import dynamicImportVars from '@rollup/plugin-dynamic-import-vars'
import copyAssets from 'rollup-plugin-copy-imported-assets'
import nodePolyfills from 'rollup-plugin-node-polyfills'
import nodeGlobals from 'rollup-plugin-node-globals'
// https://rollupjs.org/guide/en/#configuration-files
export default {
@Electroid
Electroid / worker.js
Created August 21, 2020 17:23
Cloudflare Workers HTMLRewriter with Internet Archive
// A Worker that uses async HTMLRewriter.
//
// In this example, each `img` tag in the HTML body is fetch'd
// on the edge to check if it exists. If the image returns a
// non-200 response, rewrite the `src` attribute to use the
// latest snapshot from the Internet Archive. (https://archive.org)
addEventListener('fetch', event => {
event.respondWith(fetchWithImageFix(event.request))
})
@Electroid
Electroid / maps.md
Last active August 8, 2017 02:30
Stratus Network - Private Server Maps

Basic Maps (Free)

  • Spaceship Battle
  • Interitus
  • Murta
  • NextGen
  • Coral Reef 2
  • Desert Sanctuary
  • Facility
  • Limbo II
@Electroid
Electroid / map.txt
Created March 29, 2015 15:47
Minecraft 1.8 Translations Map
language.name=English
language.region=US
language.code=en_US
gui.done=Done
gui.cancel=Cancel
gui.back=Back
gui.toMenu=Back to title screen
gui.up=Up
gui.down=Down
@Electroid
Electroid / main.css
Last active August 29, 2015 14:12
OCN C# Extracter
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Net;
using HtmlAgilityPack;
namespace ConsoleApplication1 {
@Electroid
Electroid / map.xml
Created July 6, 2014 19:31
Beauty of Ashes
<?xml version="1.0"?>
<map proto="1.3.3">
<include src="tutorial.xml"/>
<name>Beauty to Ashes</name>
<version>1.0</version>
<objective>Destroy the enemy's monument and leak their core!</objective>
<authors>
<author>artur1197</author>
<author>roro28gutier</author>
<author>Puyi2912</author>
@Electroid
Electroid / map.xml
Created July 2, 2014 21:53
Capture the Flag Template
<?xml version="1.0"?>
<map proto="1.3.3">
<name>CTF</name>
<version>0.1</version>
<objective>Capture the other team's flag and return it to your base!</objective>
<authors>
<author>ElectroidFilms</author>
</authors>
<teams>
<team color="dark red" max="8" max-overfill="12">Red Team</team>
@Electroid
Electroid / kits.xml
Created June 6, 2014 19:24
DATAcenter kits
<kits>
<kit name="obs">
<potion duration="oo" ambient="true">night vision</potion>
</kit>
<kit name="teams">
<item slot="0" damage="-3000">stone sword</item>
<item slot="1" damage="-3000" enchantment="arrow infinite">bow</item>
<item slot="2" damage="-3000">iron pickaxe</item>
<item slot="3" damage="-3000">iron axe</item>
<item slot="4" amount="64">wood</item>
@Electroid
Electroid / map.xml
Created May 3, 2014 17:33
The Factory (Prior Checks)
<?xml version="1.0"?>
<map proto="1.3.2">
<name>The Factory</name>
<version>0.1.1</version>
<objective>The attackers must destroy the endstone and packed ice monuments. The defenders must stop them before 25 minutes runs out.</objective>
<authors>
<author>ElectroidFilms</author>
</authors>
<teams>
<team color="dark red" max="36" max-overfill="40">Attackers</team>