Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Srinivas Gowda solancer

🎯
Focusing
  • Bangalore
View GitHub Profile
@solancer
solancer / countryCodeFlag.json
Created Jun 4, 2020
Country code and flag json dump
View countryCodeFlag.json
[
{
"countryName": "Afghanistan",
"countryCode": "AF",
"callingCode": "+93",
"flag": "https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Afghanistan.svg"
},
{
"countryName": "Aland Islands",
"countryCode": "AX",
@solancer
solancer / funcPatterns.js
Created Apr 7, 2020
funcPatterns for JS
View funcPatterns.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 / app.js
Created Feb 29, 2020 — forked from pantharshit00/app.js
Simple express app using JWT authentication
View app.js
/**
* 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 / alignments.css
Created Jan 31, 2020 — forked from gokulkrishh/alignments.css
CSS Layout - Align an element Horizontal & Vertical center
View alignments.css
/* HTML */
<div class="container">
<div class="child"></div>
<div>
/* Basic Style */
.container {
width: 500px;
@solancer
solancer / swipeFunc.js
Created Jan 28, 2020 — forked from localpcguy/swipeFunc.js
Simple Mobile Swipe function to get the swipe direction
View swipeFunc.js
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'){
View Hyper Terminal Settings.js
// 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 / nginx Page Speed Binary Build Notes
Created Mar 19, 2019
nginx Page Speed Binary Build Notes
View 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
View 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();
}
View 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;