Skip to content

Instantly share code, notes, and snippets.

View akshaymohite's full-sized avatar

Akshay Mohite akshaymohite

View GitHub Profile
@akshaymohite
akshaymohite / Ruby STRFTIME conversion formats.rb
Last active July 25, 2017 16:37
Ruby script to print out strftime conversion format options and outputs
# Function to print strftime results
def print_strftime_formats(a,cur_date)
a.each do |format|
b = "%#{format}"
output = cur_date.strftime(b)
puts "t.strftime('#{b}'), => #{output}"
end
end
a = ('a'..'z').to_a
@akshaymohite
akshaymohite / sign_up_form.html.erb
Last active August 29, 2015 13:56
Simple Sign Up Form in Embedded Ruby using Twitter Bootstrap
<form class="form-horizontal">
<fieldset>
<legend>Sign up using email</legend>
<div class="control-group">
<label class="control-label" for="name">Name</label>
<div class="controls">
<input id="name" name="name" type="text" placeholder="Firstname Lastname" class="input-xlarge" required="">
</div>
</div>
<div class="control-group">
@akshaymohite
akshaymohite / setting-up-vagrant-virtual-box.md
Last active April 17, 2020 10:53
Setting up Vagrant / Virtual Box
@akshaymohite
akshaymohite / command-to-backup-postgres-database.md
Created April 11, 2016 18:13
Command to Backup Postgres Database

Command to Backup Postgres database:

pg_dump database_name -U db_user_name -h host &gt; ~/backup.sql

@akshaymohite
akshaymohite / trasnfer-aws-s3-resources-from-one-account-to-other.md
Last active May 4, 2016 07:08
How to transfer AWS s3 resources from one account to other AWS s3 account?

Transfer AWS s3 resources from one account to other AWS s3 account

Step 1: Get Security Credentials

Get your AWS account Security Credentials.

Alt text

@akshaymohite
akshaymohite / key-bindings-user
Created June 21, 2016 11:38
Sublime Key Bindings (User)
[
{ "keys": ["shift+command+m"], "command": "goto_definition" },
{ "keys": ["ctrl+shift+s"], "command": "auto_save" },
{ "keys": ["ctrl+shift+t"], "command": "delete_trailing_spaces" },
{"keys": ["command+alt+i"], "command": "reindent", "args": {"single_line": false}}
]
@akshaymohite
akshaymohite / git source warnings
Created October 5, 2016 06:17
Git Source Warnings with latest bundler.
The git source `git://github.com/cloudlogistics/websocket-rails.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/cloudlogistics/sidekiq_mailer.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/cloudcastle/toolbox.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
Using rake 11.1.2
@akshaymohite
akshaymohite / app.rb
Created November 10, 2016 13:49 — forked from pacoguzman/app.rb
Testing jquery-ui sortable with capybara
# Run via: ruby -rubygems app.rb
require 'sinatra'
require 'haml'
disable :logging
get '/' do
title = "Drag'n'drop issue reduction"
haml :index
end
@akshaymohite
akshaymohite / installing-sentrifugo-on-ubuntu-16.04.md
Created April 12, 2017 11:28
Installing Sentrifugo on Ubuntu 16.04
@akshaymohite
akshaymohite / application.html.erb
Created April 14, 2017 08:45
application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Rails5GoogleMapIntegration</title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>