Skip to content

Instantly share code, notes, and snippets.

View moriyoshi's full-sized avatar
😎
I do what to do.

Moriyoshi Koizumi moriyoshi

😎
I do what to do.
View GitHub Profile
@moriyoshi
moriyoshi / colon.patch.diff
Last active August 29, 2015 14:02
Allowing a colon between the argument name and type
diff -r 5bf1a8b3aeea src/cmd/gc/go.y
--- a/src/cmd/gc/go.y Thu May 29 13:47:31 2014 -0400
+++ b/src/cmd/gc/go.y Tue Jun 03 11:47:44 2014 +0900
@@ -43,6 +43,7 @@
%token <sym> LIF LIMPORT LINTERFACE LMAP LNAME
%token <sym> LPACKAGE LRANGE LRETURN LSELECT LSTRUCT LSWITCH
%token <sym> LTYPE LVAR
+%token <sym> LRARROW
%token LANDAND LANDNOT LBODY LCOMM LDEC LEQ LGE LGT
import base64
import struct
import sys
def chunk(data):
return struct.pack('>L', len(data)) + data
data = chunk(b'ssh-rsa') + chunk(b'\x23') + chunk(b'\x00' + open(sys.argv[1]).read())
sys.stdout.write('ssh-rsa %s' % base64.b64encode(data))
@moriyoshi
moriyoshi / test.go
Last active December 25, 2015 23:39
package main
import "errors"
import "fmt"
type just struct {
fn func () (interface {}, error)
lastRetval interface {}
}
<?php
class UguisudaniException extends Exception {
}
class UguisudaniClient {
public function __construct($sock) {
$this->sock = $sock;
}
public static function connect($host, $port = 50129, $timeout = NULL) {
var xaxtsuxo = (function () {
var KEYWORDS = {
'division': 'DIVISION',
'end': 'END',
'run': 'RUN',
'if': 'IF',
'then': 'THEN',
'for': 'FOR',
'in': 'IN',
package main
@moriyoshi
moriyoshi / charfb.c
Last active December 17, 2015 23:59
#include <stdio.h>
#include <stdlib.h>
#include "charfb.h"
static int block_char_map[] = {
0x0020,
0x2598,
0x259d,
0x2580,
0x2596,
import re
from saying.exceptions import ApplicationException
from itertools import chain
class DSLSyntaxError(ApplicationException):
pass
def format(handler, text, message):
var = {
u'sender': lambda: resolve_handle(message.Sender.Handle),
package commands;
use strict;
use warnings;
use constant now => 'now';
use overload 'neg' => sub { return $_[0] };
BEGIN {
*CORE::GLOBAL::shutdown = sub(@) {
return ('shutdown', @{$_[0]});
}
public class Life {
public static void main(String[] args) {
try {
do {
good_and_bad_things();
} while (being_well_off());
} finally {
we_all_die();
}
}