This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Coded by Rajandran R | |
//Founder - Marketcalls - https://www.marketcalls.in | |
//CoFounder - Traderscafe - http://traderscafe.in | |
//Coded on 12th June 2019 | |
/* | |
Note : Before Using this Code make sure you had followed the below mentioned steps | |
1)Create a Telegram public channel | |
2)Create a Telegram BOT via BotFather |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :assets do | |
# uploads assets to s3 under assets/githash, deletes stale assets | |
task :uploadToS3, [ :to ] => :environment do |t, args| | |
from = File.join(Rails.root, 'public/assets') | |
to = args[:to] | |
hash = (`git rev-parse --short HEAD` || "").chomp | |
logger.info("[#{Time.now}] fetching keys from #{to}") | |
existing_objects_hash = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# codec: blocks | |
describe('articles.views.ArticleView'): | |
context('when user has permissions'): | |
it('should add new article'): | |
# some code | |
it('should delete existing article'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a role user (no perms). Fire up the console rails c | |
$> Role.create(:title=>'User') | |
# In your Gemfile add | |
gem 'oa-oauth', :require => 'omniauth/oauth' | |
# At the beginning of devise.rb. You can also create a yaml file and instantiate when Rails begin | |
# For shake of simplicity I added the credentials at devise.rb | |
Facebook = Rails.env.development? ? {:app_id => 2621xxx, :secret => 'e81f33d042xxxxx'} : | |
{:app_id => 1749xxx9, :secret => '13c11be6628dc1xxxx'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
private | |
# To write subdomains on the url helpers: | |
# root_url(nil, {:subdomain => "subdomain"}) | |
def url_for(options = nil) | |
case options | |
when Hash | |
if subdomain = options.delete(:subdomain) |