Skip to content

Instantly share code, notes, and snippets.


Nyan Win pyaesone17

View GitHub Profile
View gist:0380ffa458741ce195e17ab361bb5709
f, err := os.OpenFile("bar.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
log.Fatalf("error opening file: %v", err)
defer f.Close()
mw := io.MultiWriter(os.Stdout, f)
pyaesone17 /
Created Jul 10, 2018 — forked from kevin-smets/
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry


Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!


pyaesone17 / .php
Created Feb 7, 2018
route for queue
View .php
| Web Routes
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
View .php
namespace App\Jobs;
use App\User;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
View gist:d5ab9356b0252575867bb74aa297ed22
class LogManager {
protected $logger;
public function __construct($logger) {
$this->logger = $loggervar;
public function log($msg, $level)
View chunk get file
function file_get_contents_chunked($file,$chunk_size,$callback)
$handle = fopen($file, "r");
$i = 0;
while (!feof($handle))
pyaesone17 / composition.php
Created Nov 26, 2017
Go lang struct composition implementation in PHP
View composition.php
class A {
public $dependencies = [];
public function __construct(...$arguments)
$this->dependencies = $arguments;