Skip to content

Instantly share code, notes, and snippets.

View gouravtiwari's full-sized avatar

Gourav Tiwari gouravtiwari

View GitHub Profile
@kosso
kosso / gist:981250
Created May 19, 2011 17:11
Titanium sample: Multiple selection types in a window form
// Appcelerator Titanium (JS) code to produce multiple selection type data entry in a single window.
// via @CJ_Reed
// and Dan Tamas : http://cssgallery.info/making-a-combo-box-in-titanium-appcelerator-code-and-video
var win = Titanium.UI.currentWindow;
// build custom tableView data/layout
Failure/Error: Unable to find matching line from backtrace
NoMethodError:
undefined method `original_path_set' for nil:NilClass
# /Users/macmacmacmacmacmac/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.8.1/lib/rspec/rails/view_rendering.rb:113:in `block (2 levels) in <module:ViewRendering>'
# /Users/mark/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:435:in `instance_eval'
# /Users/mark/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:435:in `instance_eval_with_rescue'
# /Users/mark/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:45:in `run_in'
# /Users/mark/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:80:in `block in run_all'
# /Users/mark/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:80:in `each'
# /Users/mark/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/hooks.rb:80:in `run_all'
@nicerobot
nicerobot / README.md
Last active June 18, 2024 19:46
Mac OS X uninstall script for packaged install of node.js from https://stackoverflow.com/a/9287292/23056

To run this, you can try:

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
@NapoleonWils0n
NapoleonWils0n / curl_time_to_first_byte.sh
Created November 3, 2012 22:33
bash: curl time to first byte
curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" http://inserturl.here
@ck3g
ck3g / autocomplite.css.scss
Last active May 29, 2020 18:02
Twitter bootstrap + rails3-jquery-autocomplete gem styles
ul.ui-autocomplete {
margin-top: 2px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@epicserve
epicserve / redis_key_sizes.sh
Last active June 29, 2024 03:41
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
@gouravtiwari
gouravtiwari / turtle.rb
Last active December 22, 2015 02:29
turtuled
# Turtle shapes
# Not at all necessory, but just to show that you can define attr_accessor from module as well
module AttrLoader
def attr_loader(*attrs)
attr_accessor *attrs
end
end
@leveret
leveret / SQLite 3.6
Created September 30, 2013 11:34
SQLite3 for linux
wget http://www.sqlite.org/sqlite-autoconf-3070603.tar.gz
l
find / -name sqlite*
tar -xvf sqlite-autoconf-3070603.tar.gz
l
cd sqlite-autoconf-3070603/
l
./configure
l
make
@gouravtiwari
gouravtiwari / jenkins_setup.sh
Last active April 24, 2019 21:00
Jenkins setup on SUSE
# 1. Install jenkins
sudo zypper addrepo http://pkg.jenkins-ci.org/opensuse/ jenkins
sudo zypper install jenkins
# You would be asked something like this:
# Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): t
# Overall download size: 115.9 MiB. After the operation, additional 159.9 MiB will be used.
# Continue? [y/n/?] (y): y
# 2. Start jenkins
sudo /etc/init.d/jenkins start