Skip to content

Instantly share code, notes, and snippets.

View ferdinandsalis's full-sized avatar
🎯
Focusing

Ferdinand Salis ferdinandsalis

🎯
Focusing
View GitHub Profile
module DateTimeHelper
def format_date_range(date_range)
first = date_range.first
last = date_range.last
if same_day?(first, last)
"#{first.to_s(:month_day)}, #{first.year}"
elsif same_month?(first, last)
"#{first.to_s(:month_day)}-#{last.day}, #{last.year}"
else
"#{first.to_s(:month_day)}-#{last.to_s(:month_day)}, #{last.year}"
@mhat
mhat / a-guide.markdown
Created August 15, 2010 23:11
rolling with homebrew

Rolling with HomeBrew (rather than MacPorts)

First things first, we have to install HomeBrew. Once installed we can do pretty much everything else via HomeBrew. By default HomeBrew will install to /usr/local. It's possible to choose a different directory but everything I've read so far says it's a PITA. I'm sticking with the default.

ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"

Getting your development environment running requires a few servers. You could get by with as little as Postgres and Memcached but it'll be better if you have Nginx and RabbitMQ as well. Eventually you'll probably want Redis and Artie as well.

TODO: instructions for Redis and Artie

@cowboy
cowboy / HEY-YOU.md
Last active April 9, 2024 15:54
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
@sirupsen
sirupsen / vim7.3_mac_install.rb
Created July 27, 2011 21:57 — forked from pengwynn/vim7.3_mac_install.rb
Script to install Vim 7.3 with ruby support for Mac OS X Lion
# requires root permissions in /usr/bin/
star = String.new
8.times { star += "*" }
Star = "\n#{star * 3}\n"
def newblock string
puts "\n#{Star}#{string}#{Star}\n"
end
@adactio
adactio / flexboxtest.html
Created August 15, 2011 22:46
Content-first flexbox test
<!DOCTYPE html>
<html>
<head>
<title>Flexbox test</title>
<style>
@media screen and (min-width: 30em) {
body {
display: -webkit-box;
display: -moz-box;
display: -ms-box;
@adactio
adactio / tabledisplaytest.html
Created August 16, 2011 10:36
Content-first table-display test
<!DOCTYPE html>
<html>
<head>
<title>Table Display test</title>
<style>
@media screen and (min-width: 30em) {
body {
display: table;
caption-side: top;
}
@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name
@nathansmith
nathansmith / html5_template.html
Created December 7, 2011 01:41
Simple HTML5 Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" />
<title>untitled</title>
<link rel="stylesheet" href="" />
</head>
<body>
@miekd
miekd / css-snippet.css
Created December 27, 2011 16:02
Rounded Corner Images
.image-rounded {
border-radius: 4px;
display: inline-block;
}
.image-rounded img {
visibility: hidden;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }