Skip to content

Instantly share code, notes, and snippets.

View saneef's full-sized avatar
🐢

Saneef Ansari saneef

🐢
View GitHub Profile
@saneef
saneef / google-rt.ubiquity.js
Created May 7, 2009 01:40
Ubiquity Command - Search Google for Real Time results!
//Ubiquity Command for "google-rt", searches google for results in Realtime.
//Thanks Amit Agarwal (http://labnol.org) for the tip
//For more info on the realtime search url: http://www.labnol.org/internet/google-for-real-time-web-search/8449/
makeSearchCommand({
name: "google-rt",
homepage: "http://saneef.pixelring.net/",
author: { name: "Saneef H Ansari", email: "saneef@gmail.com"},
url: "http://www.google.com/search?as_qdr=d&q={QUERY}",
@saneef
saneef / gist:408886
Created May 21, 2010 14:19
Flipkart.com : Searches for books on flipkart.com
//Ubiquity Command for "flipkart", searches for books on Flipkart.com
CmdUtils.makeSearchCommand({
names: ["flipkart"],
url: "http://www.flipkart.com/search.php?query=%s",
defaultUrl: "http://www.flipkart.com/",
icon: "http://www.flipkart.com/favicon.ico",
parser: {
container: ".search_result_item",
title: ".search_result_image a",
@saneef
saneef / 'brew install -v pango' after removing 'brew deps pango'
Created April 9, 2012 21:36
Bug Report: Segmentation Fault while installing pango.
This file has been truncated, but you can view the full file.
==> Installing pango dependency: pkg-config
==> Downloading http://pkg-config.freedesktop.org/releases/pkg-config-0.25.tar.gz
Already downloaded: /Users/saneef/Library/Caches/Homebrew/pkg-config-0.25.tar.gz
/usr/bin/tar xf /Users/saneef/Library/Caches/Homebrew/pkg-config-0.25.tar.gz
==> ./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.25 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
./configure --disable-debug --prefix=/usr/local/Cellar/pkg-config/0.25 --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
@saneef
saneef / 'brew install' log
Created May 19, 2012 08:08
Gource: Failed executing: make install (gource.rb:33)
Darkroom:app saneef$ brew install gource
==> Downloading http://gource.googlecode.com/files/gource-0.37.tar.gz
Already downloaded: /Users/saneef/Library/Caches/Homebrew/gource-0.37.tar.gz
==> ./configure --prefix=/usr/local/Cellar/gource/0.37 --disable-sdltest --disable-freetypetest
==> make install
/usr/bin/clang++ -DPACKAGE_NAME=\"Gource\" -DPACKAGE_TARNAME=\"gource\" -DPACKAGE_VERSION=\"0.37\" -DPACKAGE_STRING=\"Gource\ 0.37\" -DPACKAGE_BUGREPORT=\"acaudwell@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"gource\" -DVERSION=\"0.37\" -DHAVE_TIMEGM=1 -DHAVE_UNSETENV=1 -DHAVE_PTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_GL_GL_H=1 -DHAVE_OPENGL_GL_H=1 -DHAVE_GL_GLU_H=1 -DHAVE_OPENGL_GLU_H=1 -DHAVE_LIBPCRE=1 -I. -DSDLAPP_RESOURCE_DIR=\"/usr/local/Cellar/gource/0.37/share/gource\" -Os -w -pipe -march=native -Qunused-arguments -I/usr/local/include -D_THREAD_
@saneef
saneef / .bash_profile
Last active December 22, 2015 01:38
# Bash Profile * Display Current Git branch together with current full path on Bash prompt * Autocomplete commands after ‘sudo’
## Git branch and current full path in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Use \W instead of \w to show only current directory
export PS1="\u@\h: \w\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
## Autocomplete after ‘sudo’
if [ "$PS1" ]; then
complete -cf sudo
@saneef
saneef / index.html
Last active August 29, 2015 14:17
Spaces
<h1>Space</h1>
<hr>
<ul class="space-list">
<li><span class="space-character">&emsp;</span>Em space <span class="ratio">M</span></li>
<li><span class="space-character">&#12288;</span>Ideographic space</li>
<li><span class="space-character">&#8199;</span>Figure space</li>
<li><span class="space-character">&ensp;</span>En space <span class="ratio">M/2</span></li>
<li><span class="space-character">&emsp13;</span>Three-per-em space <span class="ratio">M/3</span></li>
<li><span class="space-character">&puncsp;</span>Punctuation space</li>
<li><span class="space-character">&nbsp;</span>Normal space <span class="ratio">M/4</span></li>
@saneef
saneef / nth-number-of-fibnocci.js
Last active January 19, 2016 10:21
JavaScript function to get N-th Fibnocci number
function getNthFibnocci(n) {
// Based on Binets formula http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fibFormula.html#formula
return Math.round((1 / Math.sqrt(5)) * ((Math.pow((1 + Math.sqrt(5)) / 2, n) - (Math.pow((1 - Math.sqrt(5)) / 2, n)))));
}
### Keybase proof
I hereby claim:
* I am saneef on github.
* I am saneef (https://keybase.io/saneef) on keybase.
* I have a public key whose fingerprint is 2DE3 E18B 2231 F72F 103F 1A49 6DA2 919B 17B9 AA71
To claim this, I am signing this object:
@saneef
saneef / gist:3b5374d1ca7af84e07032034ca323794
Last active April 13, 2017 17:01
dokku database:backup Failure log
root@gbl-dokku-01:~# dokku --trace postgres:backup my-app-name-db my-bucket-name
+ export DOKKU_DISTRO
++ . /etc/os-release
++ echo ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOKKU_IMAGE=gliderlabs/herokuish
+ DOKKU_IMAGE=gliderlabs/herokuish
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
@saneef
saneef / gist:0957b11d59c1b9a358c7b552ee91c9e2
Last active April 25, 2017 18:55
Output of `docker inspect logspout`
[
{
"Id": "db42b8bf02160918ee1ec572544c5102b9ccd04e18b4c50d6558cf384a76cf4a",
"Created": "2017-04-25T18:53:01.838468755Z",
"Path": "/bin/logspout",
"Args": [
"syslog+tls://logs-01.loggly.com:6514"
],
"State": {
"Status": "restarting",