Skip to content

Instantly share code, notes, and snippets.

View Zenahr's full-sized avatar
💜

Zenahr Barzani Zenahr

💜
View GitHub Profile
@Zenahr
Zenahr / gist:7d70cecb7524ad44830d7481ee5e3ee4
Created July 19, 2020 18:51
Extract frames from gif via ImageMagick
`$ convert -coalesce input.gif 1_%d.png`
@Zenahr
Zenahr / gist:b2b910478692a234057756c9f41ba5c4
Last active July 12, 2020 21:50
Get elements from array and put into dom using array.map() callback
function arrayToDom(inputArray, selectorID) {
            document.getElementById(selectorID).innerHTML = '<ul>' + inputArray[count].map((item) => {
                return '<li>' + item + '</li>';
            }).join('') + '</ul>';
        }
@Zenahr
Zenahr / ftp-batch-script-single-file-upload.md
Last active July 12, 2020 21:02
batch script - FTP single file upload

Save this in a "uploadhelper.txt" file

ftp
open [FTP HOST ADDRESS]
[FTP USERNAME]
[FTP PASSWORD]
cd [FIRST SUBDIRECTORY]
cd [SECOND SUBDIRECTORY]
put index.html
quit
@Zenahr
Zenahr / snippets_pandoc.md
Last active July 3, 2020 22:20
Pandoc Snippets

Create pdf with table of content out of md

pandoc -s --toc -o output.pdf input.md
@Zenahr
Zenahr / gist:21e645b3bdfd2cf4ccf13ab6bd893773
Created June 20, 2020 03:15
Convert all images inside folder using Imagemagick
mogrify -format png *.jpg
@Zenahr
Zenahr / gist:2516d4184ccc78e91006a13b08963823
Last active June 13, 2020 16:02
Docusaurus Github Pages personal quick-guide

PUT THIS INTO SiteConfig.js:

const siteConfig = {
  title: 'Personal Laravel Docs and Recipes', // Title for your website.
  tagline: 'A Tagline I guess',
  url: 'https://Zenahr.github.io', // Your website URL
  baseUrl: '/docs-laravel/', // Base URL for your project */
  // For github.io type URLs, you would set the url and baseUrl like:
 // url: 'https://facebook.github.io',
ffmpeg -i video.mp4 -r 15 -vf scale=1920:-1 input.gif
@Zenahr
Zenahr / .config
Created June 7, 2020 11:21
Git Config Aliases
[alias]
ac = !git add -A . && git commit -m
lazy = !git add -A . && git commit -m && push origin
cm = commit -m
aacm = !git add -A . && git commit -m
cp = cherry-pick
amend = commit --amend -m
dev = !git checkout dev && git pull origin dev
staging = !git checkout staging && git pull origin staging
master = !git checkout master && git pull origin
@Zenahr
Zenahr / gist:22f5d376346c20d86642d772f0afe98e
Created May 28, 2020 08:05
[Git] delete local branches which do not have an equivalent on remote anymore (i.e. after merging)
git branch -vv (Check for the "gone" keyword)
git branch -d [branch-name]
voila, local garbage collection done.
This is the only safe and simple way to do this just using high-level git commands without scripting complicated and perhaps hazardous regex-based commands
@Zenahr
Zenahr / sos-contribution-guide-2020.md
Created May 26, 2020 21:43
SoS 2020 Project Contribution Guide

Contribution Guide

Version: 1.0

This document describes the way we will be handling our development cycles going forward

Issues

  • Issues will be made by all of us.
  • Issues will be assigned to us. This generally helps coordinate us as a team and prevent us from working on the same issue at the same time when it doesn't make sense to do so.