Skip to content

Instantly share code, notes, and snippets.

View LeCoupa's full-sized avatar
:octocat:
Keep pushing ⚡️

Julien Le Coupanec LeCoupa

:octocat:
Keep pushing ⚡️
View GitHub Profile
@LeCoupa
LeCoupa / cli.docker.sh
Last active November 21, 2023 07:33
Docker Cheatsheet + Tips & Tricks --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
docker build -t friendlyname . # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname # Same thing, but in detached mode
docker exec -it [container-id] bash # Enter a running container
docker ps # See a list of all running containers
docker stop <hash> # Gracefully stop the specified container
docker ps -a # See a list of all containers, even the ones not running
docker kill <hash> # Force shutdown of the specified container
docker rm <hash> # Remove the specified container from this machine
docker rm $(docker ps -a -q) # Remove all containers from this machine
/* *******************************************************************************************
* GLOBAL OBJECTS > ARRAY
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
* ******************************************************************************************* */
// Global object: properties
Array.length // Reflects the number of elements in an array
// Global object: methods
@LeCoupa
LeCoupa / wordpress.nginx
Last active November 8, 2023 23:26
WordPress - Nginx Configuration File (with SSL) --> https://github.com/LeCoupa/awesome-cheatsheets
##
# @server studio
# @host hackisition.com
# @desc nginx host rules
# @author Julien Le Coupanec <julien@gentlenode.com>
##
# HTTP Server
server {
listen 80;
@LeCoupa
LeCoupa / vue_js_cheatsheet.js
Last active October 23, 2023 10:38
Vue js Cheatsheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* GLOBAL CONFIG
* Vue.config is an object containing Vue’s global configurations.
* You can modify its properties listed below before bootstrapping your application.
* https://vuejs.org/v2/api/#Global-Config
* ******************************************************************************************* */
// Configure whether to allow vue-devtools inspection
Vue.config.devtools = true
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@LeCoupa
LeCoupa / 1_nanobox_cli.sh
Last active October 22, 2023 12:09
Nanobox Cheatsheet: CLI commands and Boxfile --> https://github.com/LeCoupa/awesome-cheatsheets
# *****************************************************************************
# UPDATED VERSION AVAILABLE HERE:
# https://github.com/LeCoupa/awesome-cheatsheets/blob/master/tools/nanobox_cli.sh
# *****************************************************************************
# *****************************************************************************
# LOCAL ENVIRONMENT
# *****************************************************************************
# Atom Cheatsheet.
# Project Key Bindings.
- 'cmd-shift-p': open the command palette.
- 'cmd-p' or 'cmd-t': open the fuzzy finder to find a file.
- 'cmd-b': look for a file that is already open.
- 'cmd-shift-b': search the list of files modified and untracked in your project repository.
- 'ctrl-0': open and focus the the tree view.
@LeCoupa
LeCoupa / shell_aliases
Last active August 22, 2023 13:49
Shell Aliases
##############################################################################
# SHELL ALIASES
# ADD TO .bashrc OR .zshrc
##############################################################################
# Capacitor
alias csync="npx cap sync"
alias cios="npx cap open ios"
alias cand="npx cap open android"
# NPM CheatSheet.
# Super easy intall: npm comes with node now.
# To create your own npm package: https://www.npmjs.org/doc/misc/npm-developers.html
# More: https://www.npmjs.org/doc/
# 1. NPM Command Lines.
# Local mode is the default.
# Use --global or -g on any command to operate in global mode instead.
# SYNTAX:
var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches)
var pattern = /pattern/attributes; # same as above
# BRACKETS:
[...]: Any one character between the brackets.
[^...]: Any one character not between the brackets.