This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
linear-gradient( | |
80 bottom, | |
rgb(31,79,87) 2%, | |
rgb(47,89,101) 20%, | |
rgb(101,147,150) 100%, | |
rgb(47,89,101) 100% | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PATH=/usr/local/bin:$PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css" media="screen"> | |
.field_with_errors + .label_text { | |
color: red; | |
} | |
</style> | |
<div> | |
<%= f.label :terms_levis do %> | |
<%= f.check_box :terms_levis, :class => "checkbox" %> | |
<span class="label_text">I accept <a href="#" target="_blank">the terms for Levi's Fantasy Election Weekly Challenge Sweepstakes</a>.</span> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Outputs a change log based on git tags" | |
task :changelog do | |
tags = Dir['.git/refs/tags/*'].each.with_object({}) do |path, hsh| | |
hsh[File.basename(path)] = File.read(path).chomp | |
end | |
tag_outputs = [] | |
tags.reduce(nil) do |(_, commit1), (name, commit2)| | |
tag_date = `git log -1 --format="%ci" #{commit2}`.chomp | |
lines = [ "## #{name} - #{tag_date}\n" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module CarrierWave | |
module MiniMagick | |
module ImageProcessors | |
def store_dimensions(property_name) | |
# TODO: deal with default version | |
image = ::MiniMagick::Image.open(current_path) | |
model.send("#{property_name}=", {}) unless model.send(property_name) | |
ver = (version_name || "original").to_s | |
model.send(property_name)[ver] = image["dimensions"] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%x{git branch | grep feature}.split("\n").map(&:strip).map {|o| [o, o.gsub(/^feature\//, "old/")] }.map {|(o, n)| %x{git branch -m #{o} #{n}} } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CSV_SETTINGS = { | |
headers: true, # first row is headers | |
header_converters: :symbol, # convert headers to symbols | |
converters: [ | |
-> (f) { f.present? ? f : nil }, # convert empty cells to nil | |
-> (f) { f.respond_to?(:gsub) ? f.gsub(/\s+$/, '') : f }, # convert whitespace to nil | |
:all # converts things to numbers and dates | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Alt from 'alt'; | |
let alt = new Alt(); | |
class AnimalActions { | |
run() { | |
// do some stuff | |
this.dispatch(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
} | |
img { | |
cursor: pointer; | |
} | |
.back { |