Skip to content

Instantly share code, notes, and snippets.

View markahesketh's full-sized avatar
🚀

Mark Hesketh markahesketh

🚀
View GitHub Profile
@josefarias
josefarias / _nav.html.erb
Last active May 30, 2024 20:26
Rails dropdown component using helpers and Tailwind
<nav class="flex justify-end w-full px-4">
<%= dropdown do %>
<%= dropdown_link_to "Profile", edit_user_registration_path %>
<%= dropdown_link_to "Password", edit_account_password_path %>
<%= dropdown_link_to "Social Accounts", social_accounts_path %>
<%= dropdown_link_to "Accounts", accounts_path %>
<%= dropdown_link_to "Billing", subscriptions_path %>
<%= dropdown_link_to "Other Settings", other_settings_path %>
<%= dropdown_button_to "Log out", destroy_user_session_path, method: :delete %>
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@razwan
razwan / _baseline.scss
Created April 14, 2014 16:20
Aligning type to baseline the right way with SASS
$base-font-size: 16px;
$base-line-height: 1.5;
// this value may vary for each font
// unitless value relative to 1em
$cap-height: 0.68;
@mixin baseline($font-size, $scale: 2) {
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
# MODEL
class Case < ActiveRecord::Base
include Eventable
has_many :tasks
concerning :Assignment do
def assign_to(new_owner:, details:)
transaction do
class GroupersController < ApplicationController::Base
def create
@grouper = Grouper.new(leader: current_member)
if @grouper.save
ConfirmedGrouperEmails.new(@grouper).deliver
AssignBarForGrouper.enqueue(@grouper.id)
redirect_to home_path
else
@markahesketh
markahesketh / gist:3895994
Created October 15, 2012 22:19
GIT SVN Workflow
## CLONE THE SVN
git svn clone -s <repo-url> Repository
## CREATING THE BRANCH REMOTELY AND LOCALLY
# Create the branch on the remote
git svn branch -m "BRANCH: Create DEV-branch_name - Description of branch" DEV-branch_name
# Create the branch locally
git checkout --track -b DEV-branch_name remotes/DEV-branch_name
@bzerangue
bzerangue / master.xsl
Created November 15, 2010 21:36
HTML5 Boilerplate XSLT Master Stylesheet, see html5boilerplate.com
<?xml version="1.0" encoding="UTF-8" ?>
<!--
HTML5 Boilerplate XSLT Master Stylesheet (based on Paul Irish's HTML5 Boilerplate index.html file)
Created by Brian Zerangue on 2010-11-15.
Copyright (c) 2010 Paul Irish (Everything but the XSLT), Brian Zerangue (XSLT).
HTML5 Boilerplate, http://html5boilerplate.com
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">