Skip to content

Instantly share code, notes, and snippets.

View SathyaBhat's full-sized avatar
🎶

Sathyajith Bhat SathyaBhat

🎶
View GitHub Profile
@SathyaBhat
SathyaBhat / gist:5559816
Last active December 17, 2015 05:39
Custom proforma comments for WebApps
callback(
[
{ "name": "No Product recco", "description": "Sorry, [webapps.se] doesn't do product recommendations."},
{ "name": "Nothing but a URL (and isn't spam)", "description": "Whilst this may theoretically answer the question, <a href=\"http://meta.stackoverflow.com/q/8259\">it would be preferable</a> to include the essential parts of the answer here, and provide the link for reference."},
{ "name": "Requests to OP for further information", "description": "This is really a comment, not an answer. With a bit more rep, <a href=\"http://$SITEURL$/privileges/comment\">you will be able to post comments</a>. For the moment I've added the comment for you, and I'm flagging this post for deletion."},
{ "name": "OP using an answer for further information", "description": "Please use the <em>Post answer</em> button only for actual answers. You should modify your original question to add additional information."},
@SathyaBhat
SathyaBhat / superping-close-voters
Created June 25, 2013 04:52
Adds a button for copying superping-ready user names of close voters
// ==UserScript==
// @name Copy User Links
// @author Werner Robitza
// @namespace
// @description Adds a button for copying superping-ready user names of close voters
// @include http://stackoverflow.com/*
// @include http://meta.stackoverflow.com/*
// @include http://superuser.com/*
// @include http://serverfault.com/*
// @include http://meta.superuser.com/*
@SathyaBhat
SathyaBhat / fetch-spotify-dataid.js
Created May 10, 2014 10:48
Fetches spotify data-ids from Spotify's http page. The list is then sent to spotify-to-mp3 ruby gem to download via Grooveshark. And that is how you download songs from spotify.
items = document.getElementsByClassName('play-track');
for(i= 0; i<items.length;i++) {console.log('http://open.spotify.com/track/' + items[i].getAttribute('data-id'));}
@SathyaBhat
SathyaBhat / rbangalorewiki.md
Last active August 29, 2015 14:23
/r/Bangalore Wiki

Welcome to Bangalore!

Bangalore, or Bengaluru as it is known now, has grown in stature from pensioner’s paradise to the IT capital of India. Whether you’re here for few hours or few days, there are lot of things to do, places to visit to experience Bangalore.

Food

From the traditional South Indian idli/dosas to fast food, there are plenty of options for food lovers. Here’s some of the places to visit.

stairs = input("Paste your input")
n = 0
position = 0
for s in stairs:
position += 1
if s == '(':
n += 1
elif s == ')':
n -= 1
if n == -1:

Keybase proof

I hereby claim:

  • I am sathyabhat on github.
  • I am sathyabhat (https://keybase.io/sathyabhat) on keybase.
  • I have a public key whose fingerprint is 5FCB F734 4552 EAD3 AC94 1F9F 153D 7E6D 960C 2D20

To claim this, I am signing this object:

@SathyaBhat
SathyaBhat / gist:25a3cd875975fc4403e67bf9c93eef03
Created July 25, 2016 10:51
Rename extensions of multiple files
rename "s/oldExtension/newExtension/" *.txt
via http://unix.stackexchange.com/a/159466/1648
@SathyaBhat
SathyaBhat / get_git_branches.sh
Created January 11, 2017 13:04
Get a list of all branches from a repository
#! /bin/bash
#Replace {GIT_URL} with your repo
git ls-remote --heads {GIT_URL} | aws -F" " '{print $NF}' | cut -c12- -
@SathyaBhat
SathyaBhat / mysql_stored_procs.sh
Created January 25, 2017 07:15
mysql download only stored procedures
mysqldump -n -t -d -R -u <username> -p -h <host name> <database> stored_procs.sql
@SathyaBhat
SathyaBhat / vim-bufdo
Last active April 13, 2017 09:14
vim bufdo example
Snippet to replace a sentence across multiple buffers in Vim. The `update` writes the changes to the file.
bufdo %s/depends 'mysql2_chef_gem', '\~> 1.0.1'// | update