Skip to content

Instantly share code, notes, and snippets.

View joshuachestang's full-sized avatar

Joshua Chestang joshuachestang

View GitHub Profile
class Brand < ActiveRecord::Base
# Include default devise modules.
require 'open-uri'
require 'uri'
require 'net/http'
require 'rest_client'
require 'active_support/all'
require 'csv'
devise :database_authenticatable, :registerable,
@joshuachestang
joshuachestang / stepper.dart
Created May 7, 2022 14:58
This code is for a calendar function where a user must choose a reservation date and time from a service provider's calendar. Similar to a Calendly.com.
import 'package:flutter/material.dart';
import 'package:gini/components/services/buy/bottom/calendar/table_calendar.dart';
import 'package:gini/miscellaneous/constants.dart';
import 'package:gini/models/availability/availability.dart';
import 'package:gini/models/service/service_calendar.dart';
import 'package:gini/models/service/service_calendar_table.dart';
import 'package:provider/provider.dart';
import 'time_list.dart';
import 'package:intl/intl.dart';
import 'package:flutter_native_timezone/flutter_native_timezone.dart';
@joshuachestang
joshuachestang / auth_mailer.rb
Last active November 24, 2015 18:09
Using SendWithUs with Custom Devise Mailer and sendwithus_ruby gem
class AuthMailer < Devise::Mailer
require 'rubygems'
require 'send_with_us' #after installing sendwithus_ruby gem, require the send_with_us.rb initializer file
helper :application # gives access to all helpers defined within `application_helper`.
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url`
default from: "you@example.com"
def confirmation_instructions(record, token, opts={})
# An example of elasticsearch & Tire setup for ActiveRecord associations.
#
# A `Book has_many :chapters` scenario, with mapping and JSON serialization
# for indexing associated models.
#
# Demonstrates three important caveats as of now:
#
# 1. You you have to use `touch: true` in the `belongs_to` declaration,
# to automatically notify the parent model about the update.
#