Skip to content

Instantly share code, notes, and snippets.

View rileytg's full-sized avatar

Riley Guerin rileytg

View GitHub Profile
@rileytg
rileytg / placeheld.coffee
Last active December 27, 2015 16:59
Placeheld.coffee for js placeholders
class window.Placeheld
constructor: (element) ->
@input = $(element)
placeholder = @input.attr('placeholder')
if placeholder && @input.attr('data-placeheld') != 'on'
@input.attr('placeholder', '')
@input.attr('data-placeheld', 'on')
@input.siblings().add(@input).wrap('<div class="placeholding-input"/>')
@input.after("<span class=\"placeholder\"> #{placeholder} </span>")
@input.siblings('.placeholder').click(() =>
runWithDepedencies = (dependencyArray, callable) ->
define(depedencyArray, (dependencies...) ->
callable(dependecies)
)
@rileytg
rileytg / Gemfile
Last active March 29, 2017 21:25
How to add a simple rich text editor to an active admin field
gem 'jquery-ui-rails'
gem 'font-awesome-rails'

Why do I need 106mb of JS for an empty rails app?

$ cd /tmp
$ rails -v 
Rails 6.0.3.2
$ rails new my-app 
Using -T -d postgresql from /Users/rileytg/.railsrc # use postgres, dont use tests (usually add rspec). this is a fairly common rails stack.
...
Bundle complete! 14 Gemfile dependencies, 65 gems now installed.
...
@rileytg
rileytg / .colors
Created January 20, 2022 16:56 — forked from daytonn/.colors
Bash Color functions
# Colors
end="\033[0m"
black="\033[0;30m"
blackb="\033[1;30m"
white="\033[0;37m"
whiteb="\033[1;37m"
red="\033[0;31m"
redb="\033[1;31m"
green="\033[0;32m"
greenb="\033[1;32m"