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 / config-bare.sh
Created February 11, 2015 03:06
PHP config scripts that I use
#!/bin/sh
make clean
./vcsclean
./buildconf
YACC=/usr/local/opt/bison27/bin/bison ./configure --enable-debug --enable-phpdbg "$@"
@hikari-no-yume
hikari-no-yume / v-v-n.md
Created February 11, 2015 17:19
void versus null

In languages like C, C++, C#, Java, and so on, void is used as the return type of a function that only performs side effects and does not return any value:

void foobar() {
    some_state++;
}

In such functions, it is illegal to use any form of return other than a no-value return:

void foobar() {

return; // okay

# imagine, for a second:
db = new db('mysql:localhost')
results = (
select
name, age, photo
from
db.elePHPants
where
age > 16
@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 / test.js
Last active November 12, 2016 21:37
ElePHPants Love Coffee output for test.php, over time (see: https://github.com/TazeTSchnitzel/ElePHPants-Love-Coffee)
(function () {
"use strict";
function fun_factorial(arg_0) {
var jump = -1;
goto_emulation:
while (true) {
switch (jump) {
case -1:
var cv_n = arg_0;
var var_0 = (zend_compare_function)(1, cv_n);
@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