Skip to content

Instantly share code, notes, and snippets.

View srih4ri's full-sized avatar
🔥
Lighting things on fire, brb

Srihari srih4ri

🔥
Lighting things on fire, brb
View GitHub Profile
["http://dev.ehq.local/admin/reports/status?key=reports%3Astore%3Ainformation_report%3A9%3A319%3Alast_30_days%3A2014-02-05+00%3A00%3A00+%2B1100%3A2014-03-07+00%3A00%3A00+%2B1100%3Atrue%3A%7C%7C%7C%7C%7C%3A5"]
____________________________________________________________________________________________________
["set_reports_session_prefixWriting {} to 419413b710fd1ae8e17483c37c835ad2:Admin::ReportsController "]
____________________________________________________________________________________________________
["At 3"]
____________________________________________________________________________________________________
["find_assigned_projectsWriting [\"319\"] to 419413b710fd1ae8e17483c37c835ad2:Admin::ReportsController:assigned_project_ids "]
____________________________________________________________________________________________________
["At 3"]
____________________________________________________________________________________________________
............
Retrieval is half of what Redis does best.
Before you put any data into Redis, you have to figure out how you want to get it back out. How you retrieve data is directly related to which of the five Redis data types you’ll use to store it.
To review, the five Redis data types are: strings, lists, hashes, sets, and sorted sets.
Start by asking yourself what kind of results you want from your data.
What do you need to retrieve?
#!/bin/env zsh
myproject=$1
mkdir -p $myproject $myproject/views $myproject/public $myproject/public/javascript $myproject/public/css $myproject/public/images
cd $myproject
touch Gemfile
echo "source 'https://rubygems.org' \n gem 'sinatra' \n gem 'haml' " > Gemfile
bundle
@srih4ri
srih4ri / gho.md
Last active May 19, 2016 15:14
Github Open (gho)

gho

Gho is a fish shell function :

function gho
  open https://(git config --get remote.origin.url|sed -e s/.git//g|sed s,:,/,g)/$argv
end

With gho, you can :

@srih4ri
srih4ri / deploy.sh
Created September 5, 2015 06:41
Simple shell script that imitates a Capistrano deploy.
#!/bin/sh
PATH=$PATH:/opt/ree
prod_dir='/srv/rails/myapp'
# this dir needs to have something like :
# /srv/rails/myapp
# |-- current -> releases/20110915_144041/
# |-- deploy.sh
# |-- releases
# `-- shared
@srih4ri
srih4ri / post-commit
Created September 5, 2015 07:38
GitShots. One photo of you for each commit :)
#!/bin/sh
# Install fswebcam http://manpages.ubuntu.com/manpages/lucid/man1/fswebcam.1.html
#
# Copy this file to ~/.git-templates/hooks/post-commit
# and set `git config --global init.templatedir '~/.git-templates'`
# so each of your new projects get this hook installed by default.
#
file_name="$HOME/Pictures/gitshots/`date "+%s"`.png"
Verifying that +srihari is my blockchain ID. https://onename.com/srihari
Speed.
With a cast on my right foot, walking is no longer natural for me. It takes effort to make sure I don’t exert pressure on the cast when lifting my left leg up - my walker helps me do this. The walker also makes me look like a person with some serious foot injury.
I now count the number of footsteps I need to take before I walk for getting food or water. After the first day with cast on, I realized how much I walked inside my room on a normal day. Walking was easy, and it always was fruitful - I could walk up to the kitchen and get some food, all I needed was to walk. The situation has changed now, I cannot walk for every single thing. I now plan my walks to make it a single walk to fetch everything I need or might need.
I like to believe my right foot is inside a space suit and every walk to the kitchen is a spacewalk that costs me millions. So while I go grab something to eat from the kitchen, I make it a point to bring back water. When I go fetch a cigarette, I make sure I pickup the nearest lighter

Keybase proof

I hereby claim:

  • I am srih4ri on github.
  • I am srih4ri (https://keybase.io/srih4ri) on keybase.
  • I have a public key ASB0Abof5jtkzahqIOwyv9IdG319lw1q5O4ZZAYgQgI4Ego

To claim this, I am signing this object:

@srih4ri
srih4ri / delete_branches_older_than.sh
Created May 20, 2020 15:01 — forked from vasuadari/delete_branches_older_than.sh
Script to delete branches older than a certain date, modification of 4586456
# Copy of https://gist.github.com/antonio/4586456
# With a modification to collect all the branch names so we can make one git request
# Set DRY_RUN=1 to get an echo of the command
# Format that works with `git log --since`, e.g. 2018-01-01
date=$1
branches=
for branch in $(git branch -r | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do