Skip to content

Instantly share code, notes, and snippets.

View inceabdullah's full-sized avatar
🏢
Working from office

inceabdullah

🏢
Working from office
View GitHub Profile
import delay from "delay";
const retriggerable = (token, options={}) => {
options.triggerCount = options.triggerCount || 0;
options.triggerCount++
if (options.triggerCount > options.maxTriggerCount) return options.reject("trigger count exceeded")
console.log("retriggerable trigger count:", options.triggerCount)
const cbToBePromised = async (resolve, reject) => {
if (!options.resolve && !options.reject) {
@inceabdullah
inceabdullah / .Colored Command-line Prefix.md
Last active August 20, 2023 07:08
Colored Command-line Prefix
PS1="\[\033[1;35m\]$(uname -n) \[\033[0;31m\]| \[\033[1;31m\]$(whoami) \[\033[0;31m\]- \[\033[1;31m\]$(hostname -I | awk '{ print $1 }' ) \[\033[0;31m\]| \[\033[1;36m\]\w \[\033[0;94m\]# \[\033[1;32m\]"
alias nr="npm run"
@inceabdullah
inceabdullah / docker-aliases.sh
Last active November 16, 2021 06:43 — forked from jgrodziski/docker-aliases.sh
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
alias watch='watch '
alias xargs='xargs '
alias aprint='awk "{print \$1}"'
alias bprint='awk "{print \$2}"'
alias cprint='awk "{print \$3}"'
alias zprint='awk "{print \$NF}"'
cdrun () {
( cd "$1" && shift && command "$@" )
}
alias cdd='cd ..'
#!/bin/bash
journalctl-container() {
COMMAND="journalctl CONTAINER_NAME=\"$1\" -a $2"
bash -c "$COMMAND"
}
psg() {
CMD="ps auxw | grep --color -i \[${1:0:1}\]${1:1}"
bash -c "$CMD"
@inceabdullah
inceabdullah / object2Html.js
Created August 23, 2021 11:34
in email body, to read any json-like object as html formatted to be seen easy
exports.object2Html = (obj) => JSON.stringify(obj, null, 2)
.replace(/\n\s\s\s\s\s\s/g, "<br />&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;")
.replace(/\n\s\s\s\s\s/g, "<br />&emsp;&emsp;&emsp;&emsp;&emsp;")
.replace(/\n\s\s\s\s/g, "<br />&emsp;&emsp;&emsp;&emsp;")
.replace(/\n\s\s\s/g, "<br />&emsp;&emsp;&emsp;")
.replace(/\n\s\s/g, "<br />&emsp;&emsp;")
.replace(/\n\s/g, "<br />&emsp;")
.replace(/\n/, "<br />");
@inceabdullah
inceabdullah / git_aliases
Last active August 17, 2023 08:26
Most Useful Git Aliases
#Git
alias ga='git add'
alias gc='git commit -m'
alias gca='git commit -am'
alias gcam='git commit --amend -m'
alias gf='git fetch'
alias gb='git branch -av'
alias glo='git log --oneline'
alias gp='git push'
alias gst='git status'
@inceabdullah
inceabdullah / .gitignore
Last active April 3, 2021 11:51
node.js project recommended .gitignore file
node_modules/
package-lock.json
.env

Keybase proof

I hereby claim:

  • I am inceabdullah on github.
  • I am nomorecoins (https://keybase.io/nomorecoins) on keybase.
  • I have a public key ASBkSm34xMWqqLjJDmXtFRiI53lz8HKFQwHl1teGnMA8UQo

To claim this, I am signing this object: