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
Show hidden characters
{ | |
"Vue SFC": { | |
"prefix": "sfc", | |
"scope": "vue", | |
"body": [ | |
"<template>", | |
"\t${1}", | |
"</template>", | |
"", | |
"<script>", |
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
// Anything over this threshold is considered slow | |
const THRESHOLD = 600; // 600 ms | |
// User-friendly number rounding | |
function round(value) { | |
if (!this.format) { | |
this.intl = new Intl.NumberFormat(navigator.language, { | |
maximumFractionDigits: 2, | |
}); | |
this.format = this.intl.format.bind(this.intl); |
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
/*! | |
* JavaScript preload() function | |
* Preload images, CSS and JavaScript files without executing them | |
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/ | |
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/ | |
* Demo: http://mathiasbynens.be/demo/javascript-preload | |
*/ | |
function preload(arr) { | |
var i = arr.length, |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
function makeRequest(url) { | |
fetch(url) | |
.then(response => response.json()) | |
.then(json => it.next(json)) | |
.catch(error => console.error('Somthing shit the bed', error)); | |
} | |
function *syncRequests() { | |
const redditUrl = 'https://www.reddit.com/controversial.json?count=1&limit=2'; | |
const page1 = yield makeRequest(redditUrl); |
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
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
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 Style -> JavaScript -> Spaces | |
All default + | |
√ Before parentheses -> Function declaration parentheses | |
Code Style -> JavaScript -> Other | |
Align object properties: On colon | |
Code Style -> CSS -> Other | |
Align values: On colon |
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
/* BlobBuilder.js | |
* A complete BlobBuilder shim | |
* By Eli Grey | |
* License: MIT/X11 | |
*/ | |
/*global self, unescape, encodeURIComponent */ | |
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true, | |
plusplus: true, maxerr: 50, indent: 4 */ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>IndexDB Demo - Version 1.0</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<meta name="author" content="Ido Green"/> | |
</head> | |
<style> | |
#footer { | |
background-color: yellowgreen; |