Skip to content

Instantly share code, notes, and snippets.

View hikari-no-yume's full-sized avatar
🌟
trying to save beautiful things

hikari_no_yume hikari-no-yume

🌟
trying to save beautiful things
View GitHub Profile
@hikari-no-yume
hikari-no-yume / misandry.js
Created March 7, 2015 19:50
FEMINIZER X9001 (the 1 is significant)
function misandry() {
var replaceables = Object.keys(reptable)
/* sort by length descending, value ascending
this is to ensure greedy matching */
.sort((s1, s2) => {
const lengthOrder = s2.length - s1.length;
const valueOrder = (s1 === s2) ? 0 : (s1 < s2) ? -1 : 1;
return lengthOrder ? lengthOrder : valueOrder;
}),
ueberRegex = new RegExp('\\b(' + replaceables.join('|') + ')\\b', 'gm'),
// C-like languages
// C
int factorial(int n) {
if (n <= 1) {
return 1;
} else {
return n * factorial(n - 1);
}
}
@hikari-no-yume
hikari-no-yume / ugopowunoy.hs
Last active August 29, 2015 14:19
a Haskell translation of a Minima program
--based on Ms. Hale's hastebin of Minima here: http://hastebin.com/ugopowunoy
--see: https://twitter.com/velartrill/status/591072530548535297
--her comments are preceded by "-- "
--mine are preceded by "--"
-- a sketch of the Minima language
--- - - - - - - - - - - - - - - -
-- first off, we should define a unit type
--renamed from "~"
@hikari-no-yume
hikari-no-yume / Frequently used letters.bas
Created May 13, 2015 21:54
Some old code from at least eight years ago. I was younger, then.
dim array(26)
print "Frequently used letters data gatherer."
print "Type what you want and press enter after each line."
print "Type stop and press enter to view results!"
10 input a$
if a$ = "stop" then goto 100
if len(a$) = 0 then a$ = " "
for a = 1 to len(a$)
b$ = upper$(mid$(a$, a, 1))
c = asc(b$) - 64
@hikari-no-yume
hikari-no-yume / 11sr7.php
Last active August 29, 2015 14:21
11SR-7: Hypertext Transfer Protocol Message Specification (Working Draft)
<?php
declare(strict_types=1);
namespace Room11\Standard\11SR7\HttpMessage\Interface {
/**
* @description A class to represent a Hypertext Transfer Protocol request
* @link https://standards.room11.php.committee/11sr-7/http-message-specification/working-draft/interface
* @see https://tools.ietf.org/html/rfc7540
* @version Working Draft
@hikari-no-yume
hikari-no-yume / css.md
Last active August 29, 2015 14:24
Counter-Strike: Source's win conditions

cs maps

On a cs_ (Counter-Strike) map, the Counter-Terrorist team can win by either

  1. rescuing (all) the living hostage(s), or
  2. eliminating the Terrorist team,

whereas the Terrorist team can win by either

@hikari-no-yume
hikari-no-yume / fop.md
Last active August 29, 2015 14:24
Freedom of Panorama letter I sent to Scotland MEPs on 2nd July 2015

Dear Ian Hudghton, David Coburn, Alyn Smith, Catherine Stihler, David Martin and Ian Duncan,

I am deeply concerned about European Parliament proposals which would end Freedom of Panorama – the right to photograph buildings in public spaces – in all the European Union.

I am a volunteer contributor to Wikipedia and the Wikimedia Commons - you are no doubt familiar with the former, but the latter may require introduction. The Wikimedia Commons is a sister project to Wikipedia, an online repository of freely-licensed images for any and all to make use of. Many of the images used on Wikipedia are from the Wikimedia Commons. Among other things, the Commons collects images of buildings in public spaces. For example, it contains images of the Scottish Parliament Building in Edinburgh, or of particular interest to me (as a student), images of the University of Aberdeen. These are beautiful and important buildings in our shared public spaces, and I think everyone benefits from having images of these available, both f

@hikari-no-yume
hikari-no-yume / evil.c
Last active August 29, 2015 14:27
C's switch() with only macros | http://codepad.org/4z67amon
#include "stddef.h"
#include "stdio.h"
#include "stdbool.h"
#define BEGIN_SWITCH(expr) { int _val = expr; bool chosen = false; {
#define END_SWITCH() } } _switch_end: NULL;
#define CASE(val) } if (chosen || _val == val) { chosen = true;
#define BREAK() goto _switch_end;
int main () {
@hikari-no-yume
hikari-no-yume / automaton.diff
Created May 1, 2011 00:35
Add "loadblock_hooks = grow_saplings" to bravo.ini
diff --git a/bravo/ibravo.py b/bravo/ibravo.py
index 4364969..6881d45 100644
--- a/bravo/ibravo.py
+++ b/bravo/ibravo.py
@@ -400,8 +400,16 @@ class IAutomaton(IBravoPlugin):
processing on those blocks.
"""
- blocks = Attribute("""
- List of blocks which this automaton is interested in.
diff --git a/bravo/plugins/build_hooks.py b/bravo/plugins/build_hooks.py
index 98e2bff..a6bec20 100644
--- a/bravo/plugins/build_hooks.py
+++ b/bravo/plugins/build_hooks.py
@@ -5,6 +5,7 @@ from bravo.blocks import blocks, items
from bravo.entity import Chest, Sign
from bravo.ibravo import IBuildHook
from bravo.utilities import split_coords
+from bravo.terrain import NormalTree