Skip to content

Instantly share code, notes, and snippets.

View bespokoid's full-sized avatar

Stanislav Bernstein bespokoid

View GitHub Profile
@marketcalls
marketcalls / Telegram Alerts - Modern Method.afl
Created June 11, 2019 19:51
Telegram Alerts - Modern Method
//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
@dblock
dblock / assets.rake
Created December 10, 2011 20:12
Upload assets to S3, preserve two most recent versions.
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 = {}
@yumike
yumike / blocks.py
Created December 8, 2011 06:45
Thoughts about RSpec for Python
# codec: blocks
describe('articles.views.ArticleView'):
context('when user has permissions'):
it('should add new article'):
# some code
it('should delete existing article'):
@PanosJee
PanosJee / refinery_omniauth.rb
Created March 17, 2011 22:58
Login / Register to Refinery with Omniauth (facebook, twitter, openid, etc)
# 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'}
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)