Skip to content

Instantly share code, notes, and snippets.

Sathiyaseelan sathiyaseelan

Block or report user

Report or block sathiyaseelan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sathiyaseelan
sathiyaseelan / config.yml
Created Aug 2, 2018
Sample Circle ci config to deploy a node application in heroku and run integration tests before and after release using cypress
View config.yml
# .circleci/config.yml
version: 2
defaults: &defaults
working_directory: ~/app
docker:
# the Docker image with Cypress dependencies
- image: cypress/base:8
environment:
## this enables colors in the output
TERM: xterm
@sathiyaseelan
sathiyaseelan / store_index.js
Created Jul 18, 2018
Nuxt Example for modularised Vuex Store with multiple nuxtServer Init
View store_index.js
export const actions = {
async nuxtServerInit ({ dispatch }, { app }) {
console.log('calling init methods')
await dispatch('providers/nuxtServerInit', { app })
await dispatch('products/nuxtServerInit', { app })
}
}
@sathiyaseelan
sathiyaseelan / golang_env_vars_setup.md
Created Jan 8, 2018
Using different .env files for loading environment variables.
View golang_env_vars_setup.md

Currently the godotenv library doesn't support loading different .env files such as .env.test for testing .env.staging for staging.

Here's the small snippet, to support different environments file dynamically. Based on the @adamcohen comment.(option 1)

https://github.com/joho/godotenv/issues/43 - Follow this issue for future changes

  1. Create a config struct as below
  2. Access the env values using the config struct
  3. Run the program with current ENVIRONMENT value set
@sathiyaseelan
sathiyaseelan / golang_setup.md
Last active Dec 14, 2017
Basics to setup a golang project repo in your local
View golang_setup.md

Simple Guide to setup Golang in your Mac and clone a repo.

Setup Go and workspace

Type go in terminal, to verify the installation.

  • Create a Go workspace and set GO PATH
@sathiyaseelan
sathiyaseelan / Elixir and Go lang comparison.md
Last active Dec 3, 2017
Golang and Elixir comparision with respect to building JSON APIs
View Elixir and Go lang comparison.md

Spent some time to understand go and (elixir + (phoenix)) with respect to write APIs. I’ve considered only syntax, developer productivity and features like ORM.

Golang

Pros

  1. Faster than Elixir.
  2. GORM provides similar functionality as ActiveRecord

Cons

@sathiyaseelan
sathiyaseelan / Responsive Spec Helpers With Meta tags
Last active Nov 29, 2017
Helpers for Responsive feature Specs in Capybara
View Responsive Spec Helpers With Meta tags
The responsive helpers are to help the developer with writing responsive specs.
All you have to do is, add `responsive_helper.rb` to the spec support directory.
And tag the specs with :mobile, :tablet for mobile and tablet size respectively.
If you don't use any tag, it would render the desktop size.
@sathiyaseelan
sathiyaseelan / Database cleaner configuration with multiple ORMs
Created Nov 24, 2017
Database cleaner configuration for apps using both mongoid and activerecord
View Database cleaner configuration with multiple ORMs
# Database cleaner configuration for apps using both mongoid and activerecord.
When your apps using multiple ORMs, you might want to fine tune each ORM in different way.
This contains the sample configuration for using mongoid and activerecord together.
This shows how to use different startegy for different ORMs.
View Selenium_with_headless_chrome.md

Setup for Capybara selenium with headless chrome

This gist contains all you need to setup capybara for selenium with headless chrome.

  1. Add these gems to the Gemfile under test group
  gem 'capybara'
  gem 'chromedriver-helper
  gem 'selenium-webdriver'
@sathiyaseelan
sathiyaseelan / insert_singly_circular_ll.rb
Created Apr 2, 2017
Insert in Sorted Circular Linked List
View insert_singly_circular_ll.rb
def insert(new_node)
if tail == nil
new_node.next = new_node
tail = new_node
else
curr = tail.next
while curr.next != tail && curr.data <= new_node.data
curr = curr.next
@sathiyaseelan
sathiyaseelan / count_set_bits.rb
Created Feb 24, 2017
Count number of set bits in a number (ruby)
View count_set_bits.rb
#Brian Kernighan’s algorithm
def count_set_bits(num)
count = 0
while num != 0
num &= (num-1)
count += 1
end
count
end
You can’t perform that action at this time.