View Ingame Purchase History Summarizer.js
// https://store.steampowered.com/account/history/
if($J('#load_more_button').is(":visible")) {
$J('#load_more_button').click();
console.log("Loading more history...");
} else {
var summary = Array.prototype.map.call(jQuery(".wallet_table_row:has(.wht_type div:contains(In-Game Purchase))"), (i, row) => ({
game: jQuery(".wht_items > div:first-child", row).text(),
val: Number.parseFloat(jQuery(".wht_total", row).text().trim().replace(",", "."))
})).reduce((acc, obj) => (acc[obj.game] = (acc[obj.game] || 0) + obj.val, acc), {})
for(var game in summary) {
View 0. Musings with C#
Why is it so hard to set a title, GitHub?
View Youtube to Youtube gaming.user.js
// ==UserScript==
// @name Youtube to Youtube gaming
// @namespace http://dykam.nl/
// @version 0.1
// @description Redirects the YT watch page to the better YT gaming watch page
// @author Dykam
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
View update.coffee
#!/usr/bin/env node
// Run before first use:
// $ node install request
request = require "request"
fs = require "fs"
repo = "https://repo.spongepowered.org/maven"
console.log "Downloading verison list"
View Program.cs
using Microsoft.Owin;
using Microsoft.Owin.Hosting;
using Owin;
using System;
using System.Net.Http;
namespace SelfHost
{
public class Program
{
View 0001-Allow-block-placement-when-a-the-placer-can-t-see-th.patch
From 556f679be36aa5423deda3681efaa66b4e7fb95e Mon Sep 17 00:00:00 2001
From: Dykam <kramieb@gmail.com>
Date: Thu, 16 Jan 2014 13:38:19 +0100
Subject: [PATCH] Allow block placement when a the placer can't see the player
blocking
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index cb21133..41806b2 100644
--- a/src/main/java/net/minecraft/server/World.java
View README
A small non-complete example design and implementation of Observables/Tasks integrated into events.
It is inspired by a mix of classic Observables and .NET's Tasks/SynchronizationContext.
View interfaces.java
interface TextMessage {}
interface RawTextMessage extends TextMessage { String getValue(); }
interface Style extends TextMessage { TextStyle getStyle(); TextMessage getMessage(); }
interface Action extends TextMessage { TextAction getAction(); TextEvent getEvent(); TextMessage getMessage(); }
/* Combines multiple texts */
interface Combined extends TextMessage { List<TextMessage> getMessages(); }
View Java 6 or 7.java
// When using Java 6 or 7
Observable<Vector> positions =
server.events.playerMove().map(new Fn<PlayerMoveEvent, Vector>() {
public Vector call(PlayerMoveEvent event) {
return event.getPlayer().getPosition();
}
})
.async() // continue on threadpool
.map(new Fn<Vector, Vector>() {
public Vector call(Vector vector) {
View StringUtils.java
public static final <T> T bestMatch(String search, Collection<T> options, double threshold) {
T bestObj = null;
double bestScore = 0.0D;
for (T obj : options) {
double score = LiquidMetal.score(obj.toString(), search);
if (score > bestScore) {
bestObj = obj;
bestScore = score;
} else if (score == bestScore) {
bestObj = null;