Skip to content

Instantly share code, notes, and snippets.

Gijo Varghese gijo-varghese

Block or report user

Report or block gijo-varghese

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cookie-notice.html
@gijo-varghese
gijo-varghese / cloudflare-wordpress-workder.js
Created Jun 14, 2019
Caching WordPress pages at edge using Cloudflare service workers
View cloudflare-wordpress-workder.js
// Full tutorial: https://wpspeedmatters.com/caching-wordpress-pages-using-cloudflare-service-workers
// IMPORTANT: Either A Key/Value Namespace must be bound to this worker script
// using the variable name EDGE_CACHE. or the API parameters below should be
// configured. KV is recommended if possible since it can purge just the HTML
// instead of the full cache.
// API settings if KV isn't being used
const CLOUDFLARE_API = {
email: "", // From https://dash.cloudflare.com/profile
View google-font.css
/* latin */
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans Regular'), local('OpenSans-Regular'), url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@gijo-varghese
gijo-varghese / package.json
Created Mar 9, 2019
React snap - Prerender react js without SSR
View package.json
{
"scripts": {
"postbuild": "react-snap"
},
"reactSnap": {
"skipThirdPartyRequests": true
},
"devDependencies": {
"react-snap": "^1.23.0"
}
View package.json
{
"scripts": {
"lint": "eslint 'src/**/*.{js,jsx}' --fix",
"format": "prettier --write 'src/**/*.{js,jsx,css,scss}'"
},
"lint-staged": {
"**/*.js": [
"eslint --fix",
"prettier-eslint --write",
"git add"
@gijo-varghese
gijo-varghese / .eslintrc
Created Mar 2, 2019
Eslint config for React with Airbnb style guide and prettier
View .eslintrc
{
"env": {
"browser": true
},
"extends": ["airbnb", "prettier"]
}
@gijo-varghese
gijo-varghese / .eslintrc
Created Feb 10, 2019
Additional eslint rules for nodejs
View .eslintrc
{
"env": {
"node": true
},
"extends": "airbnb-base",
"plugins": ["promise"],
"rules": {
"no-console": "error",
"promise/always-return": "error",
"promise/no-return-wrap": "error",
@gijo-varghese
gijo-varghese / settings.json
Created Feb 10, 2019
VS Code settings for Eslint and Prettier
View settings.json
{
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"prettier.eslintIntegration": true
}
@gijo-varghese
gijo-varghese / package.json
Created Feb 10, 2019
Auto lint and format with git hooks
View package.json
{
"scripts": {
"lint": "eslint 'src/**/*.js' --fix",
"format": "prettier-eslint 'server/**/*.{js,json}' --write"
},
"lint-staged": {
"**/*.js": [
"eslint --fix",
"prettier-eslint --write",
"git add"
@gijo-varghese
gijo-varghese / .eslintrc
Created Feb 10, 2019
NodeJS - Eslint Config with Airbnb Style Guide
View .eslintrc
{
"env": {
"node": true
},
"extends": "airbnb-base",
"plugins": ["promise"]
}
You can’t perform that action at this time.