Skip to content

Instantly share code, notes, and snippets.

View railsdev's full-sized avatar
🎯
Focusing

Hardik Joshi railsdev

🎯
Focusing
View GitHub Profile
Architecture Type Infrastructure Costs Development Overhead Maintenance Complexity Time to Market
Monolith $$ (Medium) $ (Low) $ (Low) Fast
Modular Monolith $$ (Medium) $$ (Medium) $$ (Medium) Medium
Microservices $$$ (High) $$$ (High) $$$ (High) Slow
@railsdev
railsdev / suite.txt
Created May 28, 2021 07:48
Testify Suite live template for IntelliJ IDEA
func Test$suite_name$Suite(t *testing.T) {
suite.Run(t, new($suite_name$TestSuite))
}
type $suite_name$TestSuite struct {
suite.Suite
}
func (suite *$suite_name$TestSuite) SetupSuite() {
@railsdev
railsdev / fetch_rubymine_license.rb
Created August 30, 2019 08:12 — forked from momenian/fetch_rubymine_license.rb
Automate rubymine license fetching
#!/usr/bin/env ruby
require 'rubygems'
require 'net/http'
require 'digest/md5'
require 'pp'
begin
require 'faker'
rescue LoadError
puts "You should install faker gem. (gem install faker)"
exit
@railsdev
railsdev / FuncChain.go
Created September 18, 2018 07:20
Func chain in golang
package main
import "fmt"
func main() {
FuncChain("a")("a", "b")("a", "b", "c")
}
func FuncChain(a string) func(a, b string) func(a, b, c string) {
return firstFunc
@railsdev
railsdev / ssh-wrapper
Last active June 13, 2018 10:21
SSH wrapper to scp files(file which are allowed to access via root only) to ec2 servers
#!/usr/bin/perl
use strict;
my @newargs = ( "ssh" );
my $added = 0;
for my $arg (@ARGV) {
# replace "scp" with "sudo scp"
if ($arg =~ /^scp / and $added == 0) {
$arg =~ s/^/sudo /;
$added = 1;
}
@railsdev
railsdev / iterm-profile.json
Created May 8, 2018 13:38
My iterm profile
{
"Use Non-ASCII Font" : true,
"Tags" : [
],
"Ansi 12 Color" : {
"Red Component" : 0.5372549295425415,
"Color Space" : "sRGB",
"Blue Component" : 0.96470588445663452,
"Alpha Component" : 1,
commands:
create_post_dir:
command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post"
command: "mkdir /opt/elasticbeanstalk/hooks/postinit"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
mode: "000755"
owner: root
group: root
@railsdev
railsdev / .spacemacs
Created July 14, 2017 06:53
My Spacemacs config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@railsdev
railsdev / RegEx phone number
Created March 22, 2017 14:54
RegEx for matching phone number with multipl extension
^(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|\*|x\.?|ext\.?|extension)\s*(\d+))*?$
# Validates below mention kind of phone number
(555)-555-5555
555-555-5555
+1-555-532-3455
866-804-5742x5111904x1212x21212
866-804-5742*1*5111904