This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// if code snippet is inside input or textarea tags | |
function copy() { | |
var codeSnippet = document.querySelector("#code-snippet"); | |
codeSnippet.select(); | |
document.execCommand("copy"); | |
} | |
document.querySelector("#copy").addEventListener("click", copy); | |
// if code snippet is inside pre or code tags | |
function copy() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Development workflow | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Production workflow | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test workflow | |
on: | |
pull_request: | |
branches: | |
- master | |
- staging | |
jobs: | |
build: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper to retrieve current device type | |
*/ | |
export const getDeviceType = () => { | |
const ua = navigator.userAgent, | |
// we could have had several if, a switch with cases, or an object containing keys and values | |
// by preference and to reduce the process we chose an array of objects containing the type of device and the test | |
types = [ | |
{ | |
type: "tablet", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch -m old new | |
git push origin :old | |
git push --set-upstream origin new | |
# alias | |
alias gmv='mv() { git branch -m $1 $2; git push origin :$1; git push --set-upstream origin $2; }; mv' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper to retrieve fields of a form as an object | |
*/ | |
export const getFormData = form => { | |
if (!form || form.tagName !== "FORM") { | |
return; | |
} | |
const { elements } = form; | |
const data = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sass/ | |
| | |
|– abstracts/ | |
| |– _variables.scss # Sass Variables | |
| |– _functions.scss # Sass Functions | |
| |– _mixins.scss # Sass Mixins | |
| |– _placeholders.scss # Sass Placeholders | |
| | |
|– base/ | |
| |– _reset.scss # Reset/normalize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper to retrieve the topmost window | |
*/ | |
export const getTopWindow = () => { | |
let w = window; | |
if (window.top) w = window.top; | |
else | |
while (w.parent) { | |
w = w.parent; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code --install-extension anthonydiametrix.ACF-Snippet | |
code --install-extension bierner.markdown-preview-github-styles | |
code --install-extension bmewburn.vscode-intelephense-client | |
code --install-extension bungcip.better-toml | |
code --install-extension ChakrounAnas.turbo-console-log | |
code --install-extension christian-kohler.npm-intellisense | |
code --install-extension christian-kohler.path-intellisense | |
code --install-extension cjhowe7.laravel-blade | |
code --install-extension cmstead.jsrefactor | |
code --install-extension CoenraadS.bracket-pair-colorizer |
NewerOlder