Skip to content

Instantly share code, notes, and snippets.

Avatar

Prasanna Kumar prasofty

  • Hyderabad, India
View GitHub Profile
@prasofty
prasofty / margin_padding_helper.css
Last active Aug 25, 2021
Margin Padding Helper CSS
View margin_padding_helper.css
.p-0 {
padding: 0px;
}
.p-3 {
padding: 3px;
}
.p-5 {
padding: 5px;
View gist:48802e79435437b4073a
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
View gist:4a8160b8e49bbb3e110b
$('#resultJSON').html(JSON.stringify(JSON.parse($('form#formQuestion').serializeJSON()),null,2));
@prasofty
prasofty / withoutxhr
Created Jun 24, 2015
for ie9 does support xhr headers
View withoutxhr
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 / .rvmrc
Last active Dec 24, 2015
rvm --rvmrc --create 2.0.0@project_name
View .rvmrc
#!/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 / database.yml
Created May 29, 2013
config/database.yml
View database.yml
//Default sqlite
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
//Default mysql2
View gist:5141715
/* 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 / gist:2487410
Created Apr 25, 2012
Disable remote links after click in rails 3
View gist:2487410
$('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');
});