Skip to content

Instantly share code, notes, and snippets.

View esparkman's full-sized avatar

Evan Sparkman esparkman

View GitHub Profile
<template>
<v-container>
<v-layout>
<v-flex xs3 v-for="customer in customers" :key="customer.id">
<v-card>
<v-card-media src="../static/male.png" height="200px">
</v-card-media>
<v-card-title primary-title>
<div>
<h3 class="headline mb-0">
class Organization < ApplicationRecord
validates :name, presence: true, uniqueness: true
validates :description, presence: true
has_many :organization_categories
has_many :categories, through: :organization_categories
has_many :locations
def self.categories_query(category_ids)
if category_ids.count == 1
{
"workbench.colorTheme": "Dracula",
"editor.fontSize": 18,
"editor.fontFamily": "Operator Mono",
"editor.fontLigatures": true,
// "vscode_custom_css.imports": ["file://Users/evansparkman/Development/vs_code_styles.css"],
"editor.tabSize": 2,
"editor.tabCompletion": true,
"editor.rulers": [80],
"editor.renderIndentGuides": true,
@esparkman
esparkman / tag.pug
Created May 12, 2017 01:04
tag.pug
extends layout
block content
.inner
h2 #{tag || 'Tags'}
ul.tags
each tag in tags
li.tag
a.tag__link(
href=`/tags/${tag._id}`
module ArticlesHelper
def markdownify(content)
pipeline_content = { gfm: true }
pipeline = HTML::Pipeline.new [
HTML::Pipeline::MarkdownFilter,
], pipeline_content
pipeline.call(content)[:output].to_s
end
end
require 'json'
json = { :array => [1, 2, 3, { :sample => "hash"} ], :foo => "bar" }
puts JSON.pretty_generate(json)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Styles Conference </title>
<link rel="stylesheet" href="assets/stylesheet/main.css">
</head>
<body>
@esparkman
esparkman / fibonacci.rb
Created August 12, 2016 18:15
Fibonacci with Recursion
@cache = [0,1]
def fib(number)
return @cache[number] if @cache[number]
@cache[number] = fib(number-1) + fib(number-2)
end
(1..50).each { |n| puts fib(n) }
@esparkman
esparkman / bootstrap-carousel.html
Created June 22, 2016 01:26 — forked from talmand/bootstrap-carousel.html
CSS changes to Bootstrap's Carousel so that the indicator dots are now thumbnails.
module Admin
class VehiclesController < Admin::ApplicationController
# To customize the behavior of this controller,
# simply overwrite any of the RESTful actions. For example:
#
# def index
# super
# @resources = Vehicle.all.paginate(10, params[:page])
# end