Skip to content

Instantly share code, notes, and snippets.

View xdevmaycry's full-sized avatar
🎯
Focusing

devmaycry xdevmaycry

🎯
Focusing
View GitHub Profile
" show hidden characters in Vim
:set list
" settings for hidden chars
" what particular chars they are displayed with
:set lcs=tab:▒░,trail:▓
" or
:set listchars=tab:▒░,trail:▓
" used \u2592\u2591 for tab and \u2593 for trailing spaces in line.
" In Vim help they suggest using ">-" for tab and "-" for trail.
@xdevmaycry
xdevmaycry / get_file_last_modified_date.js
Last active February 1, 2018 02:05
Get Last Modified Date from a Public Accessible File (Async). No external libraries required. ECMAScript 5.
/*
*
* Fiddle: https://jsfiddle.net/w79L4wan/10/
*/
function ready(callback) {
// in case the document is already rendered
if (document.readyState!='loading') callback();
// modern browsers
else if (document.addEventListener) document.addEventListener('DOMContentLoaded', callback);
#!/bin/bash
#
# /etc/rc.d/init.d/script_name
# script_name This shell script takes care of starting and stopping
# script_name (the Fedora Directory Server)
#
# Author: Brian Jones
# This e-mail address is being protected from spambots. You need JavaScript enabled to view it
# Taken from: https://www.linux.com/learn/managing-linux-daemons-init-scripts
#
@xdevmaycry
xdevmaycry / mysql-docker.sh
Last active November 1, 2018 20:57 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
###############
# MODIFIED FOR SECURITY
#
# This assumes we have the following environmental variables setup through docker composer configuration
# MYSQL_DB
# MYSQL_USER
# MYSQL_PASSWORD
###############
# Backup
@xdevmaycry
xdevmaycry / crontab.md
Last active November 2, 2018 05:50
certbot

install cron job at root

sudo crontab -e

renew every day at 10:59pm

59 22 * * * /usr/bin/certbot renew > /home/ubuntu/logs/certbot.log
@xdevmaycry
xdevmaycry / nginx.conf
Created February 22, 2019 06:24 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@xdevmaycry
xdevmaycry / .bash_profile
Last active May 24, 2019 05:22
WSL aka Windows Subsystem for Linux
## To make sure ~/.bashrc gets autoladed when launching WSL
if [[ -f ~/.bashrc ]] ; then
. ~/.bashrc
fi
## To make sure ~/.zshrc gets autoladed when launching WSL
if [[ -f ~/.zshrc ]] ; then
. ~/.zshrc
fi
@xdevmaycry
xdevmaycry / .bashrc
Created March 13, 2020 18:13
.bashrc
# pull all git repo
alias git-pull-all="find . -maxdepth 3 -name .git -type d | rev | cut -c 6- | rev | xargs -I {} git -C {} pull"
@xdevmaycry
xdevmaycry / createProvider.js
Created May 5, 2020 07:16 — forked from ArcanisCz/createProvider.js
React Error Boundary, which can catch Component + Redux + Saga errors
/*
* Usage:
* const AppProvider = createProvider(rootReducer, rootSaga);
* ...
* <AppProvider>
* <AppComponent>
* </AppProvider>
*/
const createProvider = (reducer, saga) => {
const sagaMiddleware = createSagaMiddleware();
@xdevmaycry
xdevmaycry / main.md
Last active May 3, 2023 02:00
Setup repo deploy key to allow private NPM Package hosted on Github.com be read by CircleCI

Setup repo deploy key to allow private NPM Package hosted on Github.com be read by CircleCI

Takes about 2 minutes

1. Add the private package to your project and test the git link

GitHub, private repo: