Skip to content

Instantly share code, notes, and snippets.

Makoto Tajitsu tzmfreedom

Block or report user

Report or block tzmfreedom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mail-mock.php
class MailMockStreamWrapper
private $content = '';
private $position = 0;
public function stream_open($path)
View h2o-sample.conf
user: nobody
extension: .php
port: /var/run/php-fpm/php-fpm.sock
type: unix
compress: ON
file.index: [ 'index.html', 'index.htm', 'index.txt', 'index.php' ]
View haskell-salesforce.hs
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE DeriveGeneric #-}
module Main where
import System.Environment (getArgs, getEnv)
import System.IO
import Network.HTTP.Conduit
import Network.URI
View SimpleDebugger.php
class Debugger {
private $transaction_id;
private $debug;
function __construct(bool $debug = false)
$this->transaction_id = 1;
$this->debug = $debug;
View error_listener.go
var AnnotatingErrorListener = function(annotations) {;
this.annotations = annotations;
return this;
AnnotatingErrorListener.prototype = Object.create(antlr4.error.ErrorListener.prototype);
AnnotatingErrorListener.prototype.constructor = AnnotatingErrorListener;
tzmfreedom / sample-lexer.go
Created Oct 10, 2018
Sample Lexer by golang
View sample-lexer.go
package main
import (
func main() {
l := &Lexer{input: "=+*-/===abc=a1"}
tokens := []Token{}
for {
tzmfreedom / mylogin_decode.php
Last active Sep 11, 2018
decode .mylogin.cnf to extract credential.
View mylogin_decode.php
#!/usr/bin/php -q
$fp = fopen("../.mylogin.cnf", "r");
if (!$fp) {
die("Cannot open .mylogin.cnf");
# read key
View s3_client.rb
# frozen_string_literal: true
class S3Client
def initialize(bucket_name:)
@bucket_name = bucket_name
def download(key:, filepath: nil)
return unless exist_key?(key)
if filepath
View class_self.rb
#!/usr/bin/env ruby
class Hoge
def foo
a = 123
(class << self; self; end).class_eval do
define_method(:bar) do
puts a
View lifegame.rb
#!/usr/bin/env ruby
class LifeGame
attr_accessor :height, :width, :sleep_time
def initialize(height:, width:, sleep_time: 0.25)
@height = height
@width = width
@sleep_time = sleep_time
@field = { { rand(2) == 0 } }
You can’t perform that action at this time.