Skip to content

Instantly share code, notes, and snippets.

PHP Cheatsheet

Including PHP in a file

<?php
    // place PHP code here
?>

Project root:

npm install --save-dev eslint-config-airbnb eslint-config-airbnb-typescript eslint-config-prettier eslint-config-react-app eslint-import-resolver-typescript eslint-webpack-plugin eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks babel-eslint eslint-plugin-jest @typescript-eslint/parser @typescript-eslint/eslint-plugin prettier prettier-eslint prettier-eslint-cli eslint-plugin-prettier

$ vim .eslintrc

{
  "plugins": ["prettier", "@typescript-eslint"],
@proverbed
proverbed / JavascriptBooks.md
Created September 1, 2023 07:58 — forked from WebRTCGame/JavascriptBooks.md
Free Javascript Books

Useful Links

23 Free JavaScript Books

A curated collection of awesome & free JavaScript books to help you learn the JavaScript programming language.

If you know of any other free JavaScript books that you think should be on this list, please let me know in the comments section and I will get them added.

@proverbed
proverbed / dockergrep.sh
Created February 8, 2019 07:39 — forked from roylee0704/dockergrep.sh
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@proverbed
proverbed / serverless.yml
Created January 10, 2019 12:12 — forked from DavidWells/serverless.yml
DynamoDB custom index serverless.yml example
service: service-name
provider:
name: aws
runtime: nodejs6.10
functions:
myfunc:
handler: handler.myfunc
docker rmi $(docker images -q -f dangling=true)
@proverbed
proverbed / ultimate-ut-cheat-sheet.md
Created September 7, 2018 05:17 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@proverbed
proverbed / pre-commit
Last active August 29, 2018 13:57 — forked from guilherme/gist:9604324
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='debugger\|console.log\|.only'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then
@proverbed
proverbed / curl.md
Created May 23, 2018 19:54 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@proverbed
proverbed / docker.md
Last active May 4, 2018 12:22
docker cheatsheet

Link the harmonic api and docker compose network

docker run -t -i --link harmonic-api --net composetest_default 44927adc5d84 /bin/bash

Stop all docker containers

docker stop $(docker ps -a -q)

Remove all docker containers

docker rm $(docker ps -a -q)

Execute command in running container