Skip to content

Instantly share code, notes, and snippets.

🌴
Working from home

Joel Drapper joeldrapper

🌴
Working from home
Block or report user

Report or block joeldrapper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joeldrapper
joeldrapper / application_controller.coffee
Last active Jan 1, 2018
Stimulus Controller with CoffeeScript2 Getters and Setters
View application_controller.coffee
import { Controller } from "stimulus"
export default class extends Controller
@get: (name, getter) ->
Object.defineProperty @::, name,
get: getter
configurable: true
@set: (name, setter) ->
Object.defineProperty @::, name,
View keybase.md

Keybase proof

I hereby claim:

  • I am joeldrapper on github.
  • I am joeldrapper (https://keybase.io/joeldrapper) on keybase.
  • I have a public key ASCZ2b-hvm_0Cs0MyWXInpqRI__fqd5wVAZBNBUe0nHaiQo

To claim this, I am signing this object:

View native.css
.editor-content .editable#note-text-editor {
line-height: 1.6 !important;
font-family: -apple-system, BlinkMacSystemFont, 'avenir next', avenir, helvetica, 'helvetica neue', ubuntu, roboto, noto, 'segoe ui', arial, sans-serif !important;
padding: 21px;
}
/* General */
body {
View schema.rb
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
View fout.css
@keyframes fadeIn {
0% {opacity: 0;}
100% {opacity: 1;}
}
html {
animation-duration: 0.2s;
animation-delay: 2s;
animation-name: fadeIn;
animation-fill-mode: forwards;
@joeldrapper
joeldrapper / widowfix.liquid
Created Jan 25, 2016
Widowfix for Shopify
View widowfix.liquid
{% assign words = widowfix | split: ' ' %}
{% for word in words %}{% if forloop.first %}{{word}}{% elsif forloop.last %} {{word}}{% else %} {{word}}{% endif %}{% endfor %}
@joeldrapper
joeldrapper / cleanup.js
Last active Nov 23, 2016
Cleanup WordPress
View cleanup.js
function cleanup () {
var textContent = jQuery('.wp-editor-area').val();
textContent = textContent
.replace(/(\<center\>)(["a-z,.!?':;@£$%=\[\]{}^&*()_”“–—‘’\-\+0-9 \n]*)(\<\/center\>)/ig, "<blockquote>$2</blockquote>")
.replace(/(\<img.+\/\>)/g, "\n\n")
.replace(/(\<i\>)(.*)(\<\/i\>)/g, "<em>$2</em>")
.replace(/(\<b\>)(.*)(\<\/b\>)/g, "<strong>$2</strong>");
jQuery('.wp-editor-area').val(textContent);
};
@joeldrapper
joeldrapper / content.txt
Last active Aug 29, 2015
Markdown Example
View content.txt
Right aligned
![Alt text](/path/to/image.jpg#right)
Left aligned
![Alt text](/path/to/image.jpg#left)
@joeldrapper
joeldrapper / style.css
Last active Aug 29, 2015
Markdown Image Alignment
View style.css
img {
margin-top: 20px;
margin-bottom:20px;
}
img[src*='#left'] {
float: left;
margin-right: 20px;
}
View deploy.php
<?php
shell_exec('git pull');
You can’t perform that action at this time.