Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Srinivas Gowda solancer

🎯
Focusing
Block or report user

Report or block solancer

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 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;
@solancer
solancer / API.md
Last active Feb 20, 2018 — forked from iros/API.md
Documenting your REST API
View API.md

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 Feb 19, 2018
Javascript console code to enable pasting text on sites that block it
View cpasteenable.js
var allowPaste = function(e){
 e.stopImmediatePropagation();
 return true;
};
document.addEventListener('paste', allowPaste, true);
View dev-perms-wp.sh
#!/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 Oct 20, 2017
jQuery Ajax Form With FIle Attachement
View script.js
<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();
You can’t perform that action at this time.