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 / 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 / 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
https://zocada.com/setting-mongodb-users-beginners-guide/
@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();
}
@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 / API.md
Last active February 20, 2018 10:23 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@solancer
solancer / cpasteenable.js
Created February 19, 2018 20:07
Javascript console code to enable pasting text on sites that block it
var allowPaste = function(e){
 e.stopImmediatePropagation();
 return true;
};
document.addEventListener('paste', allowPaste, true);
#!/bin/bash -ex
# SETUP PERMISSIONS
VPATH=${1%/}
GROUP_WEBWORK=${2}
WEBSERVER="www-data"
HELP="\nHelp: This script is used to fix permissions\nPlease provide the following arguments:\n\t 1) Path to web root\n\t 2) Shared workgroup of website. AKA group ownership\nNote: \"www-data\" (apache default) is assumed as the owner of the web files.\n\nUsage: [sudo] bash ${0##*/} [web_root_path] [group_name]\n"
[ -z "$VPATH" ] && VPATH=`pwd` # is null, use present dir
[ -z "$GROUP_WEBWORK" ] && GROUP_WEBWORK=webwork # is null, set default
@solancer
solancer / script.js
Created October 20, 2017 22:52
jQuery Ajax Form With FIle Attachement
<script>
jQuery(document).ready(function() {
jQuery("#proform").submit(function(e) {
e.preventDefault();
var o = jQuery(this).serializeArray(),
t = jQuery(this).attr("action"),
i = jQuery("#formResponse"),
n = jQuery("#cfsubmit"),
form_data = new FormData(jQuery('#proform')[0]);
n.text();