Skip to content

Instantly share code, notes, and snippets.

View r17x's full-sized avatar
🤘
REconciling...

RiN r17x

🤘
REconciling...
View GitHub Profile

Pagespeed Configuration Nginx for SPA [Single Page Application]

Example Case use for ReactJS with Python Flask

upstream BackEnd {
	ip_hash;
	server 127.0.0.1:8085;
	# port untuk applikasi backend
}
@r17x
r17x / prepack-gentle-intro-1.md
Created May 30, 2018 02:33 — forked from gaearon/prepack-gentle-intro-1.md
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
{
"extends": [
"eslint:recommended",
"google",
"plugin:react/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true,

Keybase proof

I hereby claim:

  • I am ri7nz on github.
  • I am ri7nz (https://keybase.io/ri7nz) on keybase.
  • I have a public key whose fingerprint is 0D90 1AC7 E602 769C 69B6 2A24 1ADA 7B78 DD1F 9F90

To claim this, I am signing this object:

@r17x
r17x / pre-commit-eslint
Last active May 29, 2018 21:24 — forked from shettayyy/pre-commit-eslint
Pre-commit hook for Linting JS with ESLint before commit.
#!/bin/sh
# don't forget chmod +x .git/hooks/pre-commit
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$")
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint"
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi

Vim Manual Install On My Ubuntu Desktop

Problem List

tlib library not found on configure 
resolve : sudo apt-get install libncurses5-dev libncursesw5-dev
/**
* My Gulp Purify && PurgeCSS
* @ri7nz
* don't forget, install save-dependencies
* $ npm install --save gulp gulp-purifycss gulp-purgecss gulp-postcss
*/
var gulp = require('gulp');
var purifycss = require('gulp-purifycss');
var purgecss = require('gulp-purgecss');
@r17x
r17x / manifest.json
Created May 15, 2018 12:16 — forked from sconstantinides/manifest.json
React PWA example
{
"short_name": "My App // Should be <= 12 characters. Appears on the home screen once installed ",
"name": "My App // Must be <= 45 characters. Appears in places with more space (install dialogs, etc.)",
"icons": [{
"src": "images/splashIcon.png // Android: Requires a PNG at least 512x512 for your startup screen. This is used along with your app name (above) and background color (below) to generate a splash screen. Learn more: https://developers.google.com/web/fundamentals/web-app-manifest/#add_a_splash_screen",
"sizes": "512x512",
"type": "image/png"
}, {
"src": "images/appIcon.png // Android requires a PNG at least 192x192 for your home screen icon",
"sizes": "192x192",
@r17x
r17x / index.html
Created May 15, 2018 12:16 — forked from sconstantinides/index.html
React PWA example
<!DOCTYPE html>
<html lang="en">
<head>
<!-- The usual suspects -->
<meta charset="utf-8">
<meta name="description"
content="My app is awesome because...">
<title>My awesome app</title>
<link rel="shortcut icon"

Example input Mask With Regex

Index.html

<html>
  <head>
  <title>Input Mask Regex</title>
    <style>
    .shell {