Skip to content

Instantly share code, notes, and snippets.

View sidtri's full-sized avatar
🎯
Focusing

sid d sidtri

🎯
Focusing
View GitHub Profile
@sidtri
sidtri / SassMeister-input.scss
Created July 13, 2014 16:59
Generated by SassMeister.com.
// ----
// Sass (v3.3.10)
// Compass (v1.0.0.alpha.20)
// ----
.hello{
padding:1px;
}
@sidtri
sidtri / gist:ea7efe5cd9d7ce1796d3
Created November 28, 2014 04:52
using constrains on root url
constraints subdomain: 'www' do
root to: 'pages#index'
end
constraints subdomain: 'admin' do
root to: 'admin/dashboard#index'
end
@sidtri
sidtri / gist:0a16498c388e46db0b8e
Created November 28, 2014 04:58
Multiple root urls
root :to => 'admin#index', :constraints => RoleConstraint.new(:admin) # When current user is an admin
root :to => 'sites#index', :constraints => RoleConstraint.new(:user) # When current user is user
root :to => 'home#index' # when no user logged in
class User < ActiveRecord::Base
has_many :questions
has_many :comments
end
class Question < ActiveRecord::Base
has_many :answers
has_many :categories
has_many :tags
end
@sidtri
sidtri / gist:4b74d53f6043fbf64af7
Created December 10, 2014 04:33
Multithreding.rb
def func1
i=0
while i<=2
puts "func1 at: #{Time.now}"
sleep(2)
i=i+1
end
end
def func2
@sidtri
sidtri / gist:cf85a1d63562299aea45
Last active August 29, 2015 14:11
Multithreading
def func1
i=0
while i<=2
puts "func1 at: #{Time.now}"
sleep(2)
i=i+1
end
end
def func2
@sidtri
sidtri / gist:813409528829fced8eb4
Created December 21, 2014 02:18
Responsive Helpline
http://formstone.it/
http://codecanyon.net/item/ultimate-grid-responsive-gallery/5093275
@sidtri
sidtri / gist:6045bf3637dbf45792ad
Last active August 29, 2015 14:12
use apt-get to install all dependencies too
sudo apt-get build-dep build-essential
not my credit ::
http://askubuntu.com/questions/214746/how-to-run-apt-get-install-to-install-all-dependencies
@sidtri
sidtri / gist:c151bbfe4e92e74fd4f7
Created December 23, 2014 09:08
Rails Attachment searching using Elastic Search
Install Elastic Search ::
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
Complete Tutorial ::
http://rny.io/rails/elasticsearch/2013/08/05/full-text-search-for-attachments-with-rails-and-elasticsearch.html
@sidtri
sidtri / gist:19efb53b7fcf4ed0fd73
Created December 24, 2014 06:00
Vagrant plus chef configuration
https://gorails.com/guides/using-vagrant-for-rails-development