This project consists of web services that is deployed with capistrano and docker-compose on a single server, and a set of interfaces, like a browser extension
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 | |
use PhpCsFixer\Config; | |
use PhpCsFixer\Finder; | |
$rules = [ | |
'array_indentation' => true, | |
'array_syntax' => ['syntax' => 'short'], | |
'binary_operator_spaces' => [ | |
'default' => 'single_space', |
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
#!/bin/bash | |
echo "enter username : " | |
read username | |
echo "enter password: " | |
read -s password | |
echo "enter course: " | |
read course |
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 ( | |
MaxWorker = os.Getenv("MAX_WORKERS") | |
MaxQueue = os.Getenv("MAX_QUEUE") | |
) | |
// Job represents the job to be run | |
type Job struct { | |
Payload Payload | |
} |
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
import Foundation | |
class StreamReader { | |
let encoding: String.Encoding | |
let chunkSize: Int | |
let fileHandle: FileHandle | |
var buffer: Data | |
let delimPattern : Data | |
var isAtEOF: Bool = false | |
Here's a common predicament: you have a value, e.g., some string or number or struct, that can be read and written by many goroutines, and you want to make sure readers and writers don't collide -- that readers get the most recently written value, and no other, and that writers don't write the value while a reader is reading it.
You may have an idea in your head about how you would approach this problem, and your idea may be completely correct. But I want to try to level up your Go-fu
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 | |
Collection::macro('maxBy', function ($callback) { | |
$callback = $this->valueRetriever($callback); | |
return $this->reduce(function ($result, $item) use ($callback) { | |
if ($result === null) { | |
return $item; | |
} | |
return $callback($item) > $callback($result) ? $item : $result; |