Skip to content

Instantly share code, notes, and snippets.

View pvin's full-sized avatar

praaveen vr pvin

View GitHub Profile
@pvin
pvin / 43534543543_change_submittion_type_to_array.rb
Last active October 28, 2020 06:28
Migration for string to array of integer type
change_column :Submitted_forms, :submittion_type, :integer, using: 'ARRAY[submittion_type]::INTEGER[]', array:true, default: []
@pvin
pvin / application.js
Created December 6, 2019 10:26
Datatables on-the-fly resizing
https://github.com/DataTables/Responsive/issues/40
https://stackoverflow.com/questions/8278981/datatables-on-the-fly-resizing/39157482#39157482
$(document).ready(function() {
$('a[data-toggle="tab"]').on( 'shown.bs.tab', function (e) {
$($.fn.dataTable.tables( true ) ).css('width', '100%');
$($.fn.dataTable.tables( true ) ).DataTable().columns.adjust().draw();
} );
});
@pvin
pvin / gist:aa8fde1dc9d5d5bd332fc7430ee1b86d
Created November 23, 2019 20:49
bootstrap-3-0-full-length-body-sidebar
https://stackoverflow.com/questions/20128472/bootstrap-3-0-full-length-body-sidebar
.user-show-navigation
--------------
var document_height = $(document).height();
var sidebar = $('.user-show-navigation');
var sidebar_height = sidebar.height();
if (document_height > sidebar_height) {
@pvin
pvin / production.rb
Last active February 2, 2024 10:18
Ruby on Rails production log rotation
# Log Rotate by initialising logger from the app
#Way one
# reference : http://ruby-doc.org/stdlib-1.9.3/libdoc/logger/rdoc/Logger.html#method-c-new
# This one from Atinder Singh https://medium.com/@atinders/easy-log-rotation-with-rails-5-7b8d3c173461
# config/environments/production.rb
Rails.application.configure do
@pvin
pvin / gist:4cece42f7d57a68c3c57c208eb541058
Last active April 8, 2020 05:30
postgres taking sql dump and undumping sql file
taking dump in server
sudo su - postgres
pg_dump ata_production > database_name_ata.sql
ls to check
server to local
scp deployer@5.145.356.214:/var/lib/postgresql/database_name.sql /home/praaveen/projects/database_name.sql
local to server
scp /home/janani/Desktop/new.csv root@1.118.36.109:/var/www/sfy-niew
@pvin
pvin / index.html
Last active July 7, 2018 09:09
react and jsx sample
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.js"></script>
<script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script>
<script type="text/babel">
var Message = React.createClass({
render:function(){
return <h1>Welcome to TutsPlus , {this.props.name}</h1>
http://sqlzoo.net/
https://github.com/vikingeducation/solution_sql_zoo
@pvin
pvin / gist:b3a7dea2a9bf91cf632dc655e10f19c7
Created February 18, 2018 12:39
Get start with express
https://www.tutorialspoint.com/expressjs/expressjs_authentication.htm
momgo + express
https://www.tutorialspoint.com/expressjs/expressjs_authentication.htm
SC STOP shortservicename
SC DELETE shortservicename
http://nssm.cc
http://www.f2ko.de/en/b2e.php
@pvin
pvin / gist:5ab2ee75e70962c562ab244d34693d0f
Created January 26, 2018 08:03
download failed Oracle JDK 7 is NOT installed.
Error in ubuntu
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1516952596_55b9e59ffae6c3f024085f23ab730ec5 [following]
--2018-01-26 13:11:17-- http://download.oracle.com/otn-pub/java/jdk/7u80-b15/jdk-7u80-linux-x64.tar.gz?AuthParam=1516952596_55b9e59ffae6c3f024085f23ab730ec5
Connecting to download.oracle.com (download.oracle.com)|23.40.72.119|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-01-26 13:11:18 ERROR 404: Not Found.
download failed