Skip to content

Instantly share code, notes, and snippets.

View tabishiqbal's full-sized avatar

Tabish Iqbal tabishiqbal

  • Toronto, Ontario
View GitHub Profile
@tabishiqbal
tabishiqbal / deploy.rb
Last active September 6, 2015 01:22 — forked from fousa/deploy.rb
Deploy with mina on DigitalOcean server.
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
require 'mina_sidekiq/tasks'
set :rails_env, 'production'
set :domain, 'YOUR_IP_OR_DOMAIN'
set :deploy_to, "/home/rails/#{rails_env}"
set :repository, 'git@github.com:fousa/<YOUR_REPOSITORY>.git'
@tabishiqbal
tabishiqbal / digital_ocean_setup.md
Created November 23, 2015 13:56 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@tabishiqbal
tabishiqbal / gmail.rb
Created April 30, 2016 21:43 — forked from pramodshinde/gmail.rb
Gmail API (via IMAP) using gmail_xoauth - Example
# An example demonstrating Gmail API via IMAP using gmail_xoauth gem
# Add this file to your rails project to use if you don't want to use this in rails project then require
require 'net/imap'
require 'gmail_xoauth'
class Gmail
attr_accessor :email, :access_token
def initialize(args)
email = args[:email]

Creating polymorphic associations

Create Tagging feature:

Create keywords to reference our media

Tag: name: (keyword)

Steps: 1 of 3

@tabishiqbal
tabishiqbal / csv.rb
Created May 17, 2016 16:46
Ruby CSV Importer
# lib/auction_core/lot_importer/csv.rb
# We use require_dependency in our app and have this file namespaced under lib.
# This file is the entry point for using the importer.
require 'parser'
module AuctionCore
module LotImporter
module Csv
def self.import(file_to_import = nil, _klass = Lot)
parser = Parser.new(file_to_import)
@tabishiqbal
tabishiqbal / application.html.erb
Created February 15, 2018 19:25 — forked from mebezac/application.html.erb
Rails Ajax Flash Messages
<div id="main" role="main">
<div class="container">
<div class="row">
<div class="span12" id="top-div"> <!--! added "top-div" id to help with ajax -->
<%= render 'layouts/messages' %>
<%= yield %>
</div>
</div>
<footer>
</footer>
@tabishiqbal
tabishiqbal / _vue-rails.md
Created September 14, 2018 14:20 — forked from przbadu/_vue-rails.md
Vue js and Rails integration

Setup Rails and Vuejs

  1. Generate new rails app using --webpack flag
rails new myApp --webpack=vue

Note:

  1. You can use --webpack=angular for angular application and --webpack=react for react.
@tabishiqbal
tabishiqbal / uppy-vue-example
Created September 20, 2018 23:37 — forked from pooot/uppy-vue-example
Very basic vuejs usage of uppy
<template>
<div :id="uppyId">
<div class="ThumbnailContainer" v-if="collection === 'thumbnail'">
<button id="open-thumbnail-modal" class="button">Select file</button>
</div>
<div class="DashboardContainer" v-else></div>
</div>
</template>
@tabishiqbal
tabishiqbal / ruby-zsh-install.sh
Created January 5, 2019 22:24 — forked from Koroeskohr/ruby-zsh-install.sh
Install Ruby with ZSH
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev
rbenv install -v 2.3.1
rbenv global 2.3.1
@tabishiqbal
tabishiqbal / homebrew-permissions-issue.md
Created January 10, 2019 00:42 — forked from irazasyed/homebrew-permissions-issue.md
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*