Skip to content

Instantly share code, notes, and snippets.

VinayaSathyanarayana

View GitHub Profile
@VinayaSathyanarayana
VinayaSathyanarayana / Keystone 5 - Secure Cookies and Reverse Proxies.md
Created Apr 11, 2020 — forked from molomby/Keystone 5 - Secure Cookies and Reverse Proxies.md
Background and instructions for fixing cookie issues encountered when deploying Keystone 5 apps behind a reverse proxy (like nginx)
View Keystone 5 - Secure Cookies and Reverse Proxies.md

Keystone 5: Secure Cookies and Reverse Proxies

Can't sign in, eh?

TL;DR

When...

  • Keystone sessions are being used (eg. for authentication)
  • secureCookies Keystone config is true (the default when NODE_ENV is 'production')
View indian.districts.geocoded.pincode.json
{
"_description: Name of City, or Town": {
"State": "The Indian State under which this City/Town exists.",
"GeoCode": [
"Latitude",
"Longitude"
],
"PinCodes": [
"All",
"The",
@VinayaSathyanarayana
VinayaSathyanarayana / server.js
Created Jan 9, 2019 — forked from pulkitsinghal/server.js
Loopback Logging - intercept all HTTP responses, regardless of which middleware/route produced it
View server.js
// Title:
// Loopback Logging - intercept all HTTP responses,
// regardless of which middleware/route produced it
// References:
// https://apidocs.strongloop.com/loopback/#app-middleware
// https://apidocs.strongloop.com/loopback/#app-middlewarefromconfig
// https://apidocs.strongloop.com/loopback/#app-definemiddlewarephases
//Sample # 1 - super simple
View 000_aggregated_migrations.rb
#-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2017 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2017 Jean-Philippe Lang
@VinayaSathyanarayana
VinayaSathyanarayana / stackPrinter.js
Created Sep 3, 2018 — forked from ErisDS/stackPrinter.js
Print an express middleware stack
View stackPrinter.js
module.exports = function stackPrinter(req, res, next) {
console.log('Printing Stack For', req.url);
function printItem(item, prefix) {
prefix = prefix || '';
if (item.route) {
console.log(prefix, 'Route', item.route.path);
} else if (item.name === '<anonymous>') {
console.log(prefix, item.name, item.handle);
@VinayaSathyanarayana
VinayaSathyanarayana / bandwidth.js
Created Aug 8, 2018 — forked from debloper/bandwidth.js
Determine client's connection speed with JavaScript
View bandwidth.js
// Let's initialize the primitives
var startTime, endTime, fileSize;
// Set up the AJAX to perform
var xhr = new XMLHttpRequest();
// Rig the call-back... THE important part
xhr.onreadystatechange = function () {
// we only need to know when the request has completed
@VinayaSathyanarayana
VinayaSathyanarayana / .eslintrc.js
Created Aug 6, 2018 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@VinayaSathyanarayana
VinayaSathyanarayana / payment.html
Created Aug 3, 2018 — forked from travist/payment.html
Form.io + Stripe Payment Processing
View payment.html
<div ng-controller="StipePayment">
<formio form="form" submission="submission"></formio>
</div>
View filter.d_nginx-auth.conf
#
# Auth filter /etc/fail2ban/filter.d/nginx-auth.conf:
#
# Blocks IPs that makes too much accesses to the server
#
[Definition]
failregex = ^<HOST> -.*"(GET|POST).*HTTP.*"
ignoreregex =
View modsecurity-nginx-ubuntu-16.04
sudo -i
apt-get update
apt-get install \
apache2-dev \
autoconf \
automake \
build-essential \
bzip2 \
You can’t perform that action at this time.