Skip to content

Instantly share code, notes, and snippets.

View solancer's full-sized avatar
🎯
Focusing

Srinivas Gowda solancer

🎯
Focusing
View GitHub Profile
@solancer
solancer / nginxReverseProxy
Created March 7, 2019 13:24
nginxReverseProxy
server {
listen 80;
listen [::]:80;
server_name SERVER.COM;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@solancer
solancer / guid gen javascript
Created March 15, 2019 06:59
guid gen javascript
function guid() {
function _p8(s) {
var p = (Math.random().toString(16)+"000000000").substr(2,8);
return s ? "-" + p.substr(0,4) + "-" + p.substr(4,4) : p ;
}
return _p8() + _p8(true) + _p8(true) + _p8();
}
https://zocada.com/setting-mongodb-users-beginners-guide/
@solancer
solancer / nginx Page Speed Binary Build Notes
Created March 19, 2019 23:54
nginx Page Speed Binary Build Notes
bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
--nginx-version "1.12.1" \
--dynamic \
-a '--with-http_ssl_module
--with-http_realip_module
--with-http_dav_module
--with-http_gzip_static_module
--with-http_gunzip_module
@solancer
solancer / Hyper Terminal Settings.js
Created May 3, 2019 09:39
Hyper Terminal Settings
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@solancer
solancer / swipeFunc.js
Created January 28, 2020 22:26 — forked from localpcguy/swipeFunc.js
Simple Mobile Swipe function to get the swipe direction
var swipeFunc = {
touches : {
"touchstart": {"x":-1, "y":-1},
"touchmove" : {"x":-1, "y":-1},
"touchend" : false,
"direction" : "undetermined"
},
touchHandler: function(event) {
var touch;
if (typeof event !== 'undefined'){
@solancer
solancer / alignments.css
Created January 31, 2020 11:53 — forked from gokulkrishh/alignments.css
CSS Layout - Align an element Horizontal & Vertical center
/* HTML */
<div class="container">
<div class="child"></div>
<div>
/* Basic Style */
.container {
width: 500px;
@solancer
solancer / app.js
Created February 29, 2020 23:20 — forked from pantharshit00/app.js
Simple express app using JWT authentication
/**
* To get started install
* express bodyparser jsonwebtoken express-jwt
* via npm
* command :-
* npm install express bodyparser jsonwebtoken express-jwt --save
*/
// Bringing all the dependencies in
const express = require('express');
@solancer
solancer / funcPatterns.js
Created April 7, 2020 10:15
funcPatterns for JS
let getDimentions = (length, height) => ({length, height});
// It is same as
getDimentions = (length, height) => {
return {length: length, height: height};
};
// function arguments defaults: Old way
getDimentions = (length, height) => {
if (!length) {
@solancer
solancer / countryCodeFlag.json
Created June 4, 2020 06:07
Country code and flag json dump
[
{
"countryName": "Afghanistan",
"countryCode": "AF",
"callingCode": "+93",
"flag": "https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Afghanistan.svg"
},
{
"countryName": "Aland Islands",
"countryCode": "AX",