This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MailMockStreamWrapper | |
{ | |
private $content = ''; | |
private $position = 0; | |
public function stream_open($path) | |
{ | |
stream_wrapper_restore("file"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user: nobody | |
file.custom-handler: | |
extension: .php | |
fastcgi.connect: | |
port: /var/run/php-fpm/php-fpm.sock | |
type: unix | |
compress: ON | |
file.index: [ 'index.html', 'index.htm', 'index.txt', 'index.php' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE NamedFieldPuns #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
module Main where | |
import System.Environment (getArgs, getEnv) | |
import System.IO | |
import Network.HTTP.Conduit | |
import Network.URI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Debugger { | |
private $transaction_id; | |
private $debug; | |
function __construct(bool $debug = false) | |
{ | |
$this->transaction_id = 1; | |
$this->debug = $debug; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AnnotatingErrorListener = function(annotations) { | |
antlr4.error.ErrorListener.call(this); | |
this.annotations = annotations; | |
return this; | |
}; | |
AnnotatingErrorListener.prototype = Object.create(antlr4.error.ErrorListener.prototype); | |
AnnotatingErrorListener.prototype.constructor = AnnotatingErrorListener; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"regexp" | |
) | |
func main() { | |
l := &Lexer{input: "=+*-/===abc=a1"} | |
tokens := []Token{} | |
for { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php -q | |
<?php | |
$fp = fopen("../.mylogin.cnf", "r"); | |
if (!$fp) { | |
die("Cannot open .mylogin.cnf"); | |
} | |
# read key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class S3Client | |
def initialize(bucket_name:) | |
@bucket_name = bucket_name | |
end | |
def download(key:, filepath: nil) | |
return unless exist_key?(key) | |
if filepath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Hoge | |
def foo | |
a = 123 | |
(class << self; self; end).class_eval do | |
define_method(:bar) do | |
puts a | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 = Array.new(height) { Array.new(width) { rand(2) == 0 } } |