Skip to content

Instantly share code, notes, and snippets.

View prasofty's full-sized avatar

Prasanna Kumar prasofty

  • Hyderabad, India
View GitHub Profile
@prasofty
prasofty / withoutxhr
Created June 24, 2015 12:02
for ie9 does support xhr headers
var $note_html = $(data);
if($note_html.hasClass('user_prospects_note')) {
$('#prospectsEmptyNotes').remove(); //if this is first note, delete empty node.
if($('#'+$note_html.attr('id')).length == 0) {
$('#user_prospects_notes .sp-container').prepend(data);
} else {
$('#'+$note_html.attr('id')).replaceWith(data);
}
$('#as-modal').modal('hide');
} else {
@prasofty
prasofty / gist:4a8160b8e49bbb3e110b
Created July 20, 2015 08:18
display json serialize
$('#resultJSON').html(JSON.stringify(JSON.parse($('form#formQuestion').serializeJSON()),null,2));
rails generate versionist:new_api_version v1.0 Api::V1a --path=value:api/v1.0 --defaults=format:json
rails generate versionist:new_controller products Api::V1
rails generate versionist:new_controller users Api::V1a
@prasofty
prasofty / gist:5141715
Last active December 14, 2015 20:09
push footer
/* Wrapper for page content to push down footer */
#wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
#header {
@prasofty
prasofty / database.yml
Created May 29, 2013 15:50
config/database.yml
//Default sqlite
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
//Default mysql2
@prasofty
prasofty / .rvmrc
Last active December 24, 2015 01:39
rvm --rvmrc --create 2.0.0@project_name
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
# Only full ruby name is supported here, for short names use:
# echo "rvm use 2.0.0" > .rvmrc
environment_id="ruby-2.0.0-p247@project88"
@prasofty
prasofty / gist:2487410
Created April 25, 2012 06:43
Disable remote links after click in rails 3
$('a[data-remote=true]').live('ajax:before', function () {
if ($(this).attr('ajax-loading')) {
return false;
} else {
$(this).attr('ajax-loading', true);
}
}).live('ajax:complete', function () {
$(this).removeAttr('ajax-loading');
});
@prasofty
prasofty / margin_padding_helper.css
Last active April 10, 2023 17:29
Margin Padding Helper CSS
.p-0 {
padding: 0px;
}
.p-3 {
padding: 3px;
}
.p-5 {
padding: 5px;