Skip to content

Instantly share code, notes, and snippets.

View nchelluri's full-sized avatar

Narsimham Chelluri nchelluri

  • Halifax, NS
View GitHub Profile
@nchelluri
nchelluri / secure_headers.rb
Created September 28, 2015 06:07
Annotated SecureHeaders Rails initializer
::SecureHeaders::Configuration.configure do |config|
# Quick reference: https://github.com/twitter/secureheaders
# <redacted-issue-num> - HSTS will be set by Ops in a downstream proxy
# if a user has visited the HTTPS version of this site, when they visit the HTTP version, their browser will edit the
# URL and use the HTTPS version instead
# https://tools.ietf.org/html/rfc6797
config.hsts = false # false disables setting the header
# <redacted-issue-num> - HPKP will be set by Ops in a downstream proxy
@nchelluri
nchelluri / gist:acf6f1db524848e21b92
Last active September 23, 2023 21:25
Ch. 2 of Full Catastrophe Living by Jon Kabat-Zinn

Chapter 2: The Foundations of Mindfulness Practice: Attitudes and Commitment

To cultivate the healing power of mindfulness requires much more than mechanically following a recipe or a set of instructions. No real process of learning is like that. It is only when the mind is open and receptive that learning and seeing and change can occur. In practicing mindfulness you will have to bring your whole being to the process. You can't just assume a meditative posture and think something will happen or play a tape and think that the tape is going to "do something" for you.

The attitude with which you undertake the practice of paying attention and being in the present is crucial. It is the soil in which you will be cultivating your ability to calm your mind and to relax your body, to concentrate and to see more clearly. If the attitudinal soil is depleted, that is, if your energy and commitment to practice are low, it will be hard to develop calmness and relaxation with any consistency. If the soil is really

@nchelluri
nchelluri / priv
Created September 3, 2014 22:38
private storage using gpg
#!/bin/bash
gpg_id='my@email.address.ca'
inv_dir="$HOME/.priv"
gpg_cmd='gpg'
edit_cmd='emacs'
pager_cmd='less'
if [ $# -ge 2 ]; then
op=$1
dev $ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 4b55aa5742d8f9fe1cef1c5b81f1826fcf047072
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit haswell
OS X: 10.9.4-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
@nchelluri
nchelluri / gem-version.rb
Last active January 2, 2016 21:09
Gem Versioning
#!/usr/bin/env ruby
puts [Gem::Version.new('4.0.0'), Gem::Version.new('4.0.0.alpha1'), Gem::Version.new('4.0.0.alpha2'), Gem::Version.new('4.0.1'), Gem::Version.new('4.1.0'), Gem::Version.new('4.1.1'), Gem::Version.new('4.1'), Gem::Version.new('4.0.0.gamma1'), Gem::Version.new('4.0.0.a1'), Gem::Version.new('4.0.0.zeta1')].sort
puts "\n\nComparing 4.0.0.alpha1 to 4.0.0: #{(Gem::Version.new('4.0.0.alpha1') <=> Gem::Version.new('4.0.0')).inspect}"
puts "\n\n4.0.0.alpha1 approximately equals: #{Gem::Version.new('4.0.0.alpha1').approximate_recommendation}"
puts "4.0.0 approximately equals: #{Gem::Version.new('4.0.0').approximate_recommendation}"
puts "4.0.1 approximately equals: #{Gem::Version.new('4.0.1').approximate_recommendation}"
puts "4.1.0 approximately equals: #{Gem::Version.new('4.1.0').approximate_recommendation}"
Mongoid Version: 3.1.4
Created documents with IDs ["5222a0a673197f377f000001", "5222a0a673197f377f000002", "5222a0a673197f377f000003"]
Looking In IDs ["5222a0a673197f377f000001", "5222a0a673197f377f000002"] and then calling #find
Find Result: 5222a0a673197f377f000003