Skip to content

Instantly share code, notes, and snippets.

View SathyaBhat's full-sized avatar
🎶

Sathyajith Bhat SathyaBhat

🎶
View GitHub Profile
@SathyaBhat
SathyaBhat / analyze_rebuild_index.sql
Created November 10, 2010 21:54
Analyze & Compute Oracle Table Statistics & Rebuild & Move indexes to different tablespace
SET NEWPAGE 0 PAGESIZE 0 FEEDBACK OFF HEADING OFF
spool analyze_rebuild_index.sql
SELECT 'ALTER TABLE '||TABLE_NAME|| ' INITRANS 30;' FROM USER_TABLES;
SELECT 'ALTER INDEX '||INDEX_NAME|| ' INITRANS 50;' FROM USER_INDEXES;
SELECT 'ALTER INDEX '||INDEX_NAME||' REBUILD TABLESPACE INDX ;' FROM USER_INDEXES;
SELECT 'ALTER INDEX '||INDEX_NAME|| ' REBUILD;' FROM USER_INDEXES;
SELECT 'ANALYZE TABLE '||TABLE_NAME ||' COMPUTE STATISTICS;' FROM USER_TABLES;
@SathyaBhat
SathyaBhat / gist:748648
Created December 20, 2010 17:05
Stupid php code to fetch images from remote server & serve it to you.
# Stupid php code to fetch images from remote server & serve it to you. Takes single image URL only.
# Replaces prior images. No caching. Horribly n00bish. Don't flame me, written with no php knowledge
index.php:
---
<HTML>
<HEAD>
<TITLE>Image Grabber </TITLE>
</HEAD>
@SathyaBhat
SathyaBhat / gist:748751
Created December 20, 2010 18:19
Bookmarklet to mobilize webpages. Ideal to bypass proxies / just get the text content
javascript: var d = document, w = window, f = 'http://instapaper.com/m', l = d.location, e = encodeURIComponent, u = f + '?u=' + e(l.href); a = function () { w.open(u); }; a();void(0)
@SathyaBhat
SathyaBhat / gist:894012
Created March 30, 2011 07:36
Chrome extensions keyboard shortcut handler
/*
Right here's the thing - for keyPress events to be run, you'll have to make use of
content scripts. Content scripts handle things at webpage & DOM level. You'll have
to do changes to your manifest:
*/
------------------------
manifest.json:
------------------------
/*
Note: don't replace manifest.json, add the relevant changes else
@SathyaBhat
SathyaBhat / fixperms.bat
Created May 14, 2011 07:25
fix permissions for "You need permissions from .. to perform this action" in Windows 7
takeown /r /d y /f *
icacls * /reset /t /c /q
var pattern=/\bIWSS/
// var mobilizr = "http://google.com/gwt/x?u="
// var mobilizr = "http://www.instapaper.com/m?u="
var mobilizr = "http://viewtext.org/article?url="
var hnold = /news.ycombinator.com/
var imgur = /imgur.com/
var new_image = "http://sbhat.me/u/fetch_images.php?ImgUrl="
var newurl
var mobi
@SathyaBhat
SathyaBhat / autoreviewcomments.user.js
Created November 24, 2011 09:09 — forked from Benjol/autoreviewcomments.user.js
Add pro-forma comments dialog for reviewing (pre-flag)
// ==UserScript==
// @name AutoReviewComments
// @namespace benjol
// @version 1.1.6
// @description Add pro-forma comments dialog for reviewing (pre-flag)
// @include http://*stackoverflow.com/questions*
// @include http://*stackoverflow.com/review*
// @include http://*stackoverflow.com/admin/dashboard*
// @include http://*serverfault.com/questions*
// @include http://*serverfault.com/review*
@SathyaBhat
SathyaBhat / gist:2273068
Created April 1, 2012 08:00
Ruby code to go through home timeline & expand t.co URLs
require 'twitter'
def setup_twitter()
Twitter.configure do |config|
config.consumer_key = ""
config.consumer_secret = ""
config.oauth_token = ""
config.oauth_token_secret = ""
end
twitter = Twitter::Client.new
// ==UserScript==
// @name Stack Exchange Retag helper
// @namespace Rob W
// @author Rob W
// @description Configurable helper to enable a quicker retagging of questions at Stack Overflow
// @include http://*.superuser.com/questions/*
// @include http://*.superuser.com/q/*
// @include http://*.superuser.com/search?*
// @include http://*.superuser.com/*/edit*
// @version 2.2
@SathyaBhat
SathyaBhat / gist:4405270
Last active December 10, 2019 15:37
Hotot filter list
###keywords
#pakvsind, #indvpak, #indvspak, daughters, rape, protest, politician, politics, shame, braveheart, #delhiProtests, greig, government, #DelhiRapists, cricket, Dhoni, obama, #cfc, #liverpool, #manutd, #mufc, liverpool, #vishwaroop, apple, ipad, bcci, #udrs, raw, #tamilbands, #afzalguru, #oppositefootballernames, Kejriwal, #AAP, #QuitAAP, Tharoor, Feku, Fekus, BJP, BDUTT, Gandhi, NaMo, Modi, KejriwalDharna, #UnitedWithAAP, #udrs, #tamilbands, #afzalguru, #oppositefootballernames, #indvspak, #ct, #iambesharam, football, cfc, moyes, feku, kejri, arsenal, #arsenal, afridi, IPL, IPL7, Robin, #PepsiIPL
###sources
world community grid, unfollowers.me, ask.fm, fllwrs, justunfollow, youversion