Skip to content

Instantly share code, notes, and snippets.

View ahmedash95's full-sized avatar

Ahmed Ammar ahmedash95

View GitHub Profile
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active April 9, 2024 14:08
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',

Overview

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

Services

@melkopisi
melkopisi / pluralsight-dl.sh
Last active December 14, 2017 01:09
download lists from pluralsight using youtube-dl
#!/bin/bash
echo "enter username : "
read username
echo "enter password: "
read -s password
echo "enter course: "
read course
var (
MaxWorker = os.Getenv("MAX_WORKERS")
MaxQueue = os.Getenv("MAX_QUEUE")
)
// Job represents the job to be run
type Job struct {
Payload Payload
}
@imjasonh
imjasonh / Post.md
Last active October 28, 2021 06:11
More Powerful Synchronization in Go, using Channels

More Powerful Synchronization in Go, using Channels

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

@adamwathan
adamwathan / maxBy.php
Created June 23, 2016 18:44
maxBy/minBy macros
<?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;
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 20, 2024 12:25
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname