Skip to content

Instantly share code, notes, and snippets.

View amad's full-sized avatar
🚀
(⌐■_■)

Ahmad Samiei amad

🚀
(⌐■_■)
View GitHub Profile
@amad
amad / main.go
Created January 7, 2018 18:53 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@amad
amad / elevatorsaga.js
Last active November 22, 2017 11:05
My basic solution for elevatorsaga.com
{
init: function(elevators, floors) {
const lessMoves = false;
var upQueue = [];
var downQueue = [];
moveToFloorNum = (elevator, floorNum, force=false) => {
if (elevator.destinationQueue.includes(floorNum)) {
elevator.goToFloor(floorNum, force);
@amad
amad / .tmux.conf
Created November 7, 2017 13:57 — forked from nicolasochem/.tmux.conf
The best tmux and vim configuration in the universe
# Our .tmux.conf file
# Setting the prefix from C-b to C-s
set -g prefix C-s
# Free the original Ctrl-b prefix keybinding
unbind C-b
#setting the delay between prefix and command
set -sg escape-time 1
# Ensure that we can send Ctrl-S to other apps
bind C-s send-prefix
@amad
amad / tmux-cheatsheet.markdown
Last active August 3, 2017 13:41 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

Todo: ctl+b+[ scroll mode

q quit scroll mode

ctl+b ctl+o rotate panes

tmux shortcuts & cheatsheet

start new:

@amad
amad / GIF-Screencast-OSX.md
Created August 2, 2017 19:30 — forked from spicycode/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

<?php
foreach(["9zojk",a2878,aa4nb,b7u9z,chbf3,eze2n,jz6rj,jz6rj,jz6rj,eze2n,cepdr,ako8z,a1pc1]as$v)echo$t=strtr(substr(base_convert($v,36,2),1),10,"* "),"* "[$k++<2],strrev($t),"\n";
for(;$o=ord(kAlgDjAbeDlCcFlCbIiDaWXXXaWbEgJdDgCdBgBgAfA[$i++]);($x+=$s)%24?:print$r.("* "[$k++<2]).strrev($r)."\n".$r="")$r.=strtr(str_repeat($b=+($o>96),$s=$o-64-$b*32),10," *");
gzinflate(base64_decode(U1CAAy0FXECLC8YAAnQNyAJAwIVFIYSPRYgLLkWEYrByLS10WTwiXAgmcYCLRPV00kGyN6BhgB4eyABZjgstyqAsuDpU5YjEgJIOEKoQigE));
alias tunnel='/home/stunt/sshuttle/sshuttle --dns -r ahd@xx.xx.xx.xx 0/0'
alias e='exit'
alias c='clear'
alias p='ping 4.2.2.3'
alias art='php artisan'
alias ga='git add'
alias gc='git commit -am'
alias desktop='cd ~/Desktop'
alias downloads='cd ~/Downloads'
alias documents='cd ~/Documents'
// by Erik Wrenholt
import java.util.*;
class Mandelbrot
{
static int BAILOUT = 16;
static int MAX_ITERATIONS = 1000;
private static int iterate(float x, float y)
{
@amad
amad / freeslashboot.txt
Last active September 3, 2016 15:59
free up /boot
dpkg --get-selections|grep 'linux-image*'|awk '{print $1}'|egrep -v "linux-image-$(uname -r)|linux-image-generic" |while read n;do apt-get -y remove $n;done
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")
1051541451431641621571721571511441234567881234567812345678123678326470547
2999999259923478990124999995689902993413269916749953349999914649932724997
2994567809912568990139956799809929936781467998299634699818991169966144990
2999994569970124995699801323459999012615302799995324993243699019923412993
2994567801993569980299356780239999456725634569974326992644399243992369936
2994567801992689901239967899029939945745315319931253399436998011992349950
2998012345299999388352999991039953991232012479934673289999982640499999415