Skip to content

Instantly share code, notes, and snippets.

View mortymacs's full-sized avatar

Morteza NourelahiAlamdari mortymacs

View GitHub Profile
minikube start --vm-driver=xhyve --container-runtime=docker --show-libmachine-logs --v=10 --alsologtostderr --cpus 4 --memory 8192
@systemed
systemed / gist:be2d6bb242d2fa497b5d93dcafe85f0c
Last active February 19, 2025 08:29
Routing algorithm implementations
(Dijkstra and plain A* are generally not included here as there are thousands of
implementations, though I've made an exception for rare Ruby and Crystal versions,
and for Thor, Mapzen's enhanced A*. )
A* Ruby https://github.com/georgian-se/shortest-path
A* Crystal https://github.com/petoem/a-star.cr
A* (bidirectional with shortcuts) C++ https://github.com/valhalla/valhalla
NBA* JS https://github.com/anvaka/ngraph.path
NBA* Java https://github.com/coderodde/GraphSearchPal
NBA* Java https://github.com/coderodde/FunkyPathfinding
@mortymacs
mortymacs / A.markdown
Last active September 14, 2017 02:59 — forked from umpirsky/A.markdown
Sublime Text Monokai Sidebar Theme.
@peterhellberg
peterhellberg / ffmpeg-example.go
Created April 23, 2017 15:44
FFmpeg from Go usage example
package main
import (
"os/exec"
)
func newCmd(imageFile, audioFile, outFile string) *exec.Cmd {
return exec.Command("ffmpeg",
"-r", "1",
"-loop", "1",
@keithweaver
keithweaver / create-folder.py
Created March 10, 2017 03:42
Create a folder with Python
import os
def createFolder(directory):
try:
if not os.path.exists(directory):
os.makedirs(directory)
except OSError:
print ('Error: Creating directory. ' + directory)
@arrayed
arrayed / AdjacencyMatrixGraphImp.cpp
Last active April 29, 2022 21:59
Adjacency Matrix Graph Implementation in C++
//============================================================================
// Name : AdjacencyMatrixGraphImp.cpp
// Author : Amritpal Singh
// Copyright : arrayed.net
// Description : Array based Adjacency Matrix Graph Implimentation
//============================================================================
#include <iostream>
#include <vector>
#include <string>
@oifland
oifland / Jenkinsfile
Last active July 15, 2024 06:36
Loops in Jenkinsfiles
// Related to https://issues.jenkins-ci.org/browse/JENKINS-26481
abcs = ['a', 'b', 'c']
node('master') {
stage('Test 1: loop of echo statements') {
echo_all(abcs)
}
stage('Test 2: loop of sh commands') {
@lummie
lummie / enum.go
Last active March 24, 2025 01:09
Golang Enum pattern that can be serialized to json
package enum_example
import (
"bytes"
"encoding/json"
)
// TaskState represents the state of task, moving through Created, Running then Finished or Errorred
type TaskState int
@mihow
mihow / load_dotenv.sh
Last active April 25, 2025 17:10
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@mortymacs
mortymacs / .vimrc
Last active March 2, 2017 09:51
My vim config file
" Default settings
set number
syntax enable
set showmatch
set encoding=utf-8
set nocompatible
set paste
set nowrap
set tabstop=2 shiftwidth=2
set expandtab