Skip to content

Instantly share code, notes, and snippets.

@tiennou
tiennou / screeps-creep-birthday.user.js
Created May 15, 2024 20:37
Screeps - Show Creep Birthday
// ==UserScript==
// @name Screeps Birthday viewer
// @namespace http://tampermonkey.net/
// @version 2024-05-15
// @description This adds a creep's birthday to the inspector
// @author Traxus, various
// @run-at document-ready
// @match https://screeps.com/a/
// @icon https://www.google.com/s2/favicons?sz=64&domain=screeps.com
// @require https://raw.githubusercontent.com/Esryok/screeps-browser-ext/master/screeps-browser-core.js
@tiennou
tiennou / screeps-console-shard-color.user.js
Created February 5, 2024 23:28
Screeps - Console Shard Coloring
// ==UserScript==
// @name Screeps - Console Shard Coloring
// @version 2024-02-05
// @description This tweaks the background colors of console logs from each shard to improve clarity
// @author Traxus
// @match https://screeps.com/a/*
// @grant none
// ==/UserScript==
@tiennou
tiennou / screeps-server-commands.md
Last active November 18, 2024 07:57
CLI Commands for Screeps server

CLI Commands for Screeps server

Here's a collection of commands to use server powers to do various things. Be careful when using them, I usually find and print an object's state before editing it, since it's very easy to get in a broken state by editing the database directly like that and having the previous values helps in reconstructing it if you mess up.

// Refresh every room's image assets
storage.db.rooms.find().then(rooms => Promise.all(rooms.map(({ _id }) => map.updateRoomImageAssets(_id))));
@tiennou
tiennou / espanso-convert.rb
Last active September 25, 2020 11:52
Quick-'n-dirty TextExpander to espanso converter
#!/usr/bin/env ruby
require 'plist'
require 'optimist'
require 'yaml'
opts = Optimist::options do
version "0.1.0"
banner <<-EOS
espando-convert converts a TextExpander snippet file to espando's YML syntax
@tiennou
tiennou / kernel.rb
Last active March 2, 2019 11:25
Ruby Kernel#silence_warnings
module Kernel
def silence_warnings
with_warnings(nil) { yield }
end
def with_warnings(flag)
old_verbose, $VERBOSE = $VERBOSE, flag
yield
ensure
$VERBOSE = old_verbose
@tiennou
tiennou / dnscontrol.js
Created August 29, 2018 12:22
dnscontrol multi-dom aliasing
var ALLDOM = function(/* [[base, tld, …] | [dn, …], …], definer */) {
var args = Array.prototype.slice.call(arguments)
var defined = args.shift()
var definer = args.shift()
defined.forEach(function(tlds) {
var base = null
if (Array.isArray(tlds) && tlds.length > 1) {
base = tlds.shift()
} else {
This file has been truncated, but you can view the full file.
Analysis of sampling TextMate (pid 1025) every 1 millisecond
Process: TextMate [1025]
Path: /Applications/TextMate 2.app/Contents/MacOS/TextMate
Load Address: 0x109dfc000
Identifier: com.macromates.TextMate
Version: 2.0-rc.10 (9800)
Code Type: X86-64
Parent Process: ??? [1]
Date/Time: 2018-06-22 13:33:00.584 +0200
-- The C compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
@tiennou
tiennou / zalgolizer.rb
Created May 18, 2017 22:38
A Ruby command line tool for your zalgo needs
#!/usr/bin/env ruby -w
# encoding: utf-8
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.banner = "#{File.basename($0)} [-dz] [string to zalgo|-]"
opts.on "-d", "--debug", "Debug mode" do |v| options[:debug] = v; end
@tiennou
tiennou / crashreport.rb
Created April 17, 2017 17:00
QS Crash report wrangler
# A Ruby module for OS X crash-report-wrangling
#
# https://developer.apple.com/library/content/technotes/tn2004/tn2123.html
require 'digest/md5'
require 'shellwords'
$debug = false
def debug(str)