Skip to content

Instantly share code, notes, and snippets.

View jimvickery's full-sized avatar

Jim Vickery jimvickery

  • Ingram Software Engineer - Grad of Nashville Software School
  • Nashville, TN
View GitHub Profile
@stevecondylios
stevecondylios / contact-form-rails-6.md
Last active April 2, 2024 15:50
Create a Contact Form in Rails 6

How to make a contact form in rails 6

This is a quick walk through on how to:

  1. make a contact form in rails 6,
  2. test it locally, and
  3. move it into production using heroku and the MailGun addon

This uses the free heroku and mailgun plans. If you get stuck on any part, check the full code here.

@robertohein
robertohein / App.tsx
Last active January 15, 2024 22:00
React Native WebView persist state from localStorage on AsyncStorage and load state from AsyncStorage (useful with redux-persist)
import React, { useEffect, useRef, useState } from 'react';
import { StyleSheet } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { SafeAreaView } from 'react-native-safe-area-context';
import WebView, { WebViewMessageEvent } from 'react-native-webview';
import { StatusBar } from 'expo-status-bar';
enum MessageTypes {
@maxivak
maxivak / webpacker_rails.md
Last active November 3, 2024 21:38
Webpack, Yarn, Npm in Rails
@mrmartineau
mrmartineau / stimulus.md
Last active April 9, 2025 15:37
Stimulus cheatsheet
@nickangtc
nickangtc / simple_calendar_tutorial.md
Created October 15, 2016 02:07
How to use Simple Calendar Rails gem

Using Simple Calendar for Rails

Objectives

  • Use simple_calendar gem to easily generate calendars in a Rails project.
  • Understand how the calendar is generated and how to customise it.

What is simple calendar?

Simple calendar is a Rails gem that generates a calendar for use in your views.

You can use simple calendar to generate monthly and weekly calendars.

@vmarcetic
vmarcetic / ability.rb
Created July 21, 2013 20:51
Better view of article on coderwall
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # This is used for not logged user if you have a need for it
if User.current_role == 'admin' # From ApplicationController we can get current_role and check it up against the role we want.
can :manage, :all
else