Skip to content

Instantly share code, notes, and snippets.

View moaazsidat's full-sized avatar
👋

Moaaz Sidat moaazsidat

👋
View GitHub Profile
start = function() {
framer code
}
preloadImages = ["img1.png", "img2.png"];
preloadImagesCount = 0; // How many images were loaded
preloadImages.map(function(image) {
var imageLayer = new Layer({image:image})
imageLayer.on("load", function() {
@moaazsidat
moaazsidat / .bash_profile
Last active June 20, 2020 02:32
Colorized, Git-friendly Terminal Setup
test -f ~/.git-completion.bash && . $_
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
alias gti='git'
alias gi='git'
alias octave='open -na Octave-cli'
alias unity='open -na Unity'
alias py27='source activate py27'
@moaazsidat
moaazsidat / index.html
Last active February 7, 2016 20:51 — forked from anonymous/index.html
Redux Primer - Counter Example
<!DOCTYPE html>
<html>
<head>
<script src="http://fb.me/react-with-addons-0.14.0.js"></script>
<script src="http://fb.me/react-dom-0.14.0.js"></script>
<!-- <script src="https://npmcdn.com/expect/umd/expect.min.js"></script> -->
<script src="https://wzrd.in/standalone/expect@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.3.0/redux.js"></script>
<meta charset="utf-8">
<title>React Hello World w/ JSBin</title>
@moaazsidat
moaazsidat / index.html
Last active February 7, 2016 20:52 — forked from anonymous/index.html
Redux Primer - Todo App
<!DOCTYPE html>
<html>
<head>
<script src="http://fb.me/react-with-addons-0.14.0.js"></script>
<script src="http://fb.me/react-dom-0.14.0.js"></script>
<!-- <script src="https://npmcdn.com/expect/umd/expect.min.js"></script> -->
<script src="https://wzrd.in/standalone/expect@latest"></script>
<script src="https://wzrd.in/standalone/deep-freeze@latest"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.3.0/redux.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.0.0/react-redux.js"></script>
@moaazsidat
moaazsidat / git_autocompletion.md
Last active January 7, 2017 00:04
apple stackexchange answer for git autocomplete that's a life saver

Source

ok, so I needed the git autocompletion script.

I got that from this url:

curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@moaazsidat
moaazsidat / code_to_pages.md
Created May 20, 2017 23:07
Code to Pages (macOS)

1- Install highlight

brew install highlight

2- copy your file to your clipboard

highlight --syntax=YOURLANGUAGE -O rtf YOURFILE | pbcopy
@moaazsidat
moaazsidat / merge_pdfs_command_line.md
Last active September 9, 2023 16:45
merge pdfs command line
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf *.pdf

Try the good ghostscript:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf mine1.pdf mine2.pdf or even this way for an improved version for low resolution PDFs (thanks to Adriano for pointing this out):

@moaazsidat
moaazsidat / split_mp3.md
Created July 20, 2017 19:19
Split mp3 audio files by duration

This worked for me when I tried it on a mp3 file.

$ ffmpeg -i somefile.mp3 -f segment -segment_time 3 -c copy out%03d.mp3 Where -segment_time is the amount of time you want per each file (in seconds).

References

Splitting an audio file into chunks of a specified length 4.22 segment, stream_segment, ssegment - ffmpeg documentation

@moaazsidat
moaazsidat / mp3title.sh
Created July 20, 2017 21:12
command to set mp3 title to file name
#!/bin/sh
FILES=*.mp3
for f in $FILES
do
echo "Processing ${f%.*}"
id3tag "--song=${f%.*} $f"
done