Skip to content

Instantly share code, notes, and snippets.

View devinhalladay's full-sized avatar
🌱
running my fingers through the grass

Devin Halladay devinhalladay

🌱
running my fingers through the grass
View GitHub Profile
@karteek
karteek / custom_404_for_tumblr.js.htm
Created December 19, 2009 18:49
A way to enable custom 404 for Tumblr. Well, it 'kinda' works
<script type="text/javascript">
/* Works for me */
var text_posts = document.getElementsByClassName("regular");
var text_404 = "The URL you requested could not be found.";
var title_404 = "Not Found";
if(text_posts.length == 1){
var bodyNode = text_posts[0].lastChild;
if(bodyNode.previousSibling.textContent == text_404) {
// titleNode.innerHTML = "<a href='/'>Not Found</a>";
var blog_loc = "http://" + document.domain + "/";
@ghickman
ghickman / _contact.rb
Created July 4, 2010 17:23
Jekyll Contact Form with Sinatra
require 'rubygems'
require 'sinatra'
require 'pony'
require 'haml'
set :haml, {:format => :html5}
set :public, File.dirname(__FILE__)
set :views, File.dirname(__FILE__)
# Create the page class and give it a title of Contact for the layout
<!--
A quick fix for my friend Chris Bowler.
http://chrisbowler.com/journal/alternate-css-files
-->
<link rel="stylesheet" media="screen" id="time_style" href="/-/css/day.css" />
<script>
@sevenspark
sevenspark / styles.css
Created December 20, 2011 04:58
ThemeSwitcher + Preview
/* Preview hover styles */
#theme_list ul li {
position:relative;
}
.product-preview{
position:absolute;
left:100%;
top:-1px;
margin-left:1px;
background:#222;
@moshen
moshen / devonly_tag.rb
Created April 17, 2012 04:53
Jekyll Dev Only Tag
#
# Jekyll Dev Only Tag
#
# Author : Colin Kennedy
# Usage :
#
# The markup/script/css included within the `devonly` tags
# is included in the rendered page when either:
#
# * `server` mode is used
@briangonzalez
briangonzalez / README.md
Created October 21, 2012 04:25
img2boxshadow - a ruby script to convert images to CSS [http://codepen.io/briangonzalez/details/AvrGI#pen-details-tab]

img2boxshadow.rb

a ruby script to convert images to CSS (box-shadows)

Installation

gem install rmagick    # you'll need ImageMagick & Ruby first
gem install colormath
gem install micro-optparse
@tbjers
tbjers / .travis.yml
Created July 30, 2013 03:00
Script for use with Travis CI to build and deploy a Jekyll site to Github Pages
language: ruby
rvm:
- 1.9.3
script: rake generate
after_success: bash post_build.sh
@snrbrnjna
snrbrnjna / exclude_home.rb
Created November 29, 2013 20:24
To exclude some configurable posts from Jekyll's default pagination on index.html pages
module Jekyll
module Generators
class Pagination
# Monkey patch this method to exclude some cats and tags from all standard
# paginators
#
# For this to take effect, you have to define a ``exclude_home`` property in your _config.yml:
#
# exclude_home:
# categories: [notes]
@23maverick23
23maverick23 / font_awesome.rb
Last active January 30, 2022 11:38
Jekyll: Font Awesome icons Liquid tag
##
# The MIT License (MIT)
#
# Copyright (c) 2014 Ryan Morrissey
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@calebd
calebd / ArrayHelpers.swift
Last active November 4, 2022 15:17
Swift Helpers
extension Array {
func first() -> Element? {
if isEmpty {
return nil
}
return self[0]
}
func last() -> Element? {