Skip to content

Instantly share code, notes, and snippets.

View mayuresh-srivastava's full-sized avatar
🏠
Working from home

Mayuresh Srivastava mayuresh-srivastava

🏠
Working from home
View GitHub Profile
@mayuresh-srivastava
mayuresh-srivastava / README.md
Created July 26, 2016 11:08 — forked from fnichol/README.md
Download a cacert.pem for RailsInstaller

Why?

There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.

From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?

Installation

The Ruby Way! (Fun)

@mayuresh-srivastava
mayuresh-srivastava / faq.html
Created July 27, 2016 17:21 — forked from neilgee/faq.html
FAQ Page with Show and Hide Questions and Answers
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
$(document).ready(function() {
$('.faq_question').click(function() {
if ($(this).parent().is('.open')){
$(this).closest('.faq').find('.faq_answer_container').animate({'height':'0'},500);
$(this).closest('.faq').removeClass('open');

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@mayuresh-srivastava
mayuresh-srivastava / pg_import_csv_to_heroku.sh
Created September 14, 2016 12:56 — forked from jboesch/pg_import_csv_to_heroku.sh
Importing a CSV dump of Postgres data into Heroku
# You have your csv data and it looks like so... It's in a file named "my_data.csv" and we want to import it into a table named "my_things".
"1", "Something", "0.50", "2013-05-05 10:00:00"
"2", "Another thing", "1.50", "2013-06-05 10:30:00"
# Now you want to import it, go to the command line and type:
$ PGPASSWORD=PWHERE psql -h HOSTHERE -U USERHERE DBNAMEHERE -c "\copy my_things FROM 'my_data.csv' WITH CSV;"
# Voila! It's impoted. Now if you want to wipe it out and import a fresh one, you would do this:
@mayuresh-srivastava
mayuresh-srivastava / default.css
Created October 5, 2016 06:42 — forked from anonymous/default.css
User Registration Widget CSS files.
/*------------------------------------*\
JANRAIN CAPTURE WIDGET DEFAULT.CSS
\*------------------------------------*/
/*
* Default.css acts as a base stylesheet for the capture widget which you can
* extend/modify with your own theme stylesheet.
*
* Default.css aims to set a baseline of styling and standard coloring to elements
* that could appear in your capture widget.
*
@mayuresh-srivastava
mayuresh-srivastava / string_boolean.rb
Last active October 7, 2016 22:09 — forked from equivalent/README.md
String "false" to_bool ... or how to convert Rails/SimpleForm radio buttons to boolean
module StringToBoolean
def to_bool
return true if self == true || self =~ (/^(true|t|yes|y|1)$/i)
return false if self == false || self.blank? || self =~ (/^(false|f|no|n|0)$/i)
raise ArgumentError.new("invalid value for Boolean: \"#{self}\"")
end
end
class String; include StringToBoolean; end
module BooleanToBoolean
console.log("Start");
setTimeout(function(){
console.log("I am Insdie the TimeOut");
}, 3000);
console.log("Ends");
@mayuresh-srivastava
mayuresh-srivastava / .gitattributes
Created August 10, 2018 18:10 — forked from tpope/.gitattributes
Fewer conflicts in your Rails apps
Gemfile.lock merge=bundlelock
db/schema.rb merge=railsschema
require 'benchmark'
N = 10_000_000
Benchmark.bmbm do |bm|
bm.report('String') do
N.times do
a = 'foobarfoobarhmm'
a.sub('foo', 'BAR')
end

Cover Letter

My name is Ivo and I am an Italian agile software developer who loves coding and solving problems in a simple yet creative fashion. During my years of web development I have grown a strong passion for fronted development which led me to a good understanding of its underlaying technologies. I love hacking the hell out of web apps and getting a grasp of cutting edge technologies in order to keep up with time and deliver the best user experience possible.

While user experience still plays a big role in what I enjoy doing, I've learnt how important it is to write stable yet maintainable and scalable backend solutions. Even though I started out with PHP, I soon naturally came closer to the NodeJS environment while still embracing more "elegant" technologies such as Ruby or Java either adopting frameworks or by implementing architectures from scratch.

I discovered the Agile Manifesto and eXtreme Programming back while joining XPeppers in 2013 and I’ve tried my best to apply either values and prin