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 / hello.vue
Created May 22, 2020 07:29 — forked from ryenski/hello.vue
Stimulus.js + Vue.js
<template>
<div id="app">
<p>{{ message }}</p>
</div>
</template>
<script>
export default {
data: function () {
return {
@tabishiqbal
tabishiqbal / __readme.md
Created April 30, 2020 05:23 — forked from maxivak/__readme.md
Tree with ancestry. Rails

Contents:

  • show full path for the item
  • show tree in ol li
  • show tree in dropdown select

Show full path for item

  • one item
:plain
var existingModal = document.querySelector("[data-controller='modal']");
if (existingModal) {
document.body.removeChild(existingModal);
}
document.body.insertAdjacentHTML("beforeend", "#{j render partial: template.to_s}");
@tabishiqbal
tabishiqbal / _new_account_form.html.erb
Created March 25, 2020 22:33
Rails / Alpinejs tabbed registration form
<div class="w-2/6 p-5">
<%= render partial: 'shared/global/logo' %>
<div class="flex w-full justify-center my-4">
<p class="text-center w-full body-font text-2xl font-semibold text-primary-700">Free 14 Day Trial Registration</p>
</div>
<div class="w-full mt-4">
<%= form_for(@account, html: { class: 'w-full p-3' }) do |f| %>
<% if @account.errors.any? %>
<div id="error_explanation">
@tabishiqbal
tabishiqbal / brandIcon.js
Created September 26, 2019 16:34 — forked from jschatz1/brandIcon.js
Using Bulma: A little branding for your brand inputs
{
getters: {
brandIcon() {
return (text, defaultIcon) => {
const isBrand = brandIcons.includes(text.toLowerCase());
if (isBrand) {
return `fa-${text.toLowerCase()}`;
}
return `fa-${defaultIcon}`;
};
def create
@room = Room.find(params[:room_id])
@event = @room.events.create(event_params)
@event.create_recurring_events
end
@tabishiqbal
tabishiqbal / async-await.js
Created February 10, 2019 04:56 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@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)/*

@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 / 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>