Skip to content

Instantly share code, notes, and snippets.

View craigcoles's full-sized avatar
:shipit:
Shippers gonna ship

Craig Coles craigcoles

:shipit:
Shippers gonna ship
View GitHub Profile
@sumul
sumul / _fonts.scss
Created July 17, 2014 21:55
A list of SASS variables to help manage numerical CSS font-weight values.
// Weights
$hairline-weight: 100;
$thin-weight: 200;
$light-weight: 300;
$normal-weight: 400;
$medium-weight: 500;
$semibold-weight: 600;
$bold-weight: 700;
$xbold-weight: 800;
$black-weight: 900;
@jordelver
jordelver / gist:8863630
Created February 7, 2014 14:33
Middleman - Disable directory indexes for individual page

Middleman - Disable directory indexes for individual page

Add directory_index: false to the frontmatter of your page

--
directory_index: false
--
@anchetaWern
anchetaWern / php-webscraping.md
Created August 4, 2013 13:18
web scraping in php

Have you ever wanted to get a specific data from another website but there's no API available for it? That's where Web Scraping comes in, if the data is not made available by the website we can just scrape it from the website itself.

But before we dive in let us first define what web scraping is. According to Wikipedia:

{% blockquote %} Web scraping (web harvesting or web data extraction) is a computer software technique of extracting information from websites. Usually, such software programs simulate human exploration of the World Wide Web by either implementing low-level Hypertext Transfer Protocol (HTTP), or embedding a fully-fledged web browser, such as Internet Explorer or Mozilla Firefox. {% endblockquote %}

@sgb-io
sgb-io / .bash_profile
Created July 25, 2013 23:51
Peep Show essentials for terminal.
# Welcome message
open_green_escape="\033[36m"
open_yellow_escape="\033[31m"
close_escape="\033[0m"
# Some of my fave peep show quotes.
funny_quotes=(
'What if I lose it? Im not gonna do a poo am I, Jez?'
'For the worst thing that could possibly happen, this is actually going extremely well.'
'Is this a terrible idea? It cant be. Its in a film. They wouldnt put a terrible idea in a film, theyd get sued.'
@benjaminreid
benjaminreid / breaking_bad.rb
Last active December 16, 2015 02:28
A Git hook (commit-msg) to append a Breaking Bad quote to end of your commit messages, obviously.
#!/usr/bin/env ruby
message_file = ARGV[0]
message = File.read(message_file)
def range_rand(min,max)
min + rand(max-min)
end
bads = [
"Yeah, bitch! Magnets!",
@davefp
davefp / LICENSE.md
Last active April 1, 2021 04:30
Weather Widget for Dashing

The MIT License (MIT)

Copyright (c) 2014 David Underwood

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 furnished to do so, subject to the following conditions:

@stuntbox
stuntbox / gist:4557917
Last active March 23, 2023 03:32
Slightly smarter filtering to remove hard-coded width and height attributes from *all* images in WordPress (post thumbnails, images inserted into posts, and gravatars). Handy for responsive designs. Add the code below to the functions.php file in your theme's folder (/wp-content/themes/theme-name/ ). Remember to rename the function as needed to …
/**
* Filter out hard-coded width, height attributes on all images in WordPress.
* https://gist.github.com/4557917
*
* This version applies the function as a filter to the_content rather than send_to_editor.
* Changes made by filtering send_to_editor will be lost if you update the image or associated post
* and you will slowly lose your grip on sanity if you don't know to keep an eye out for it.
* the_content applies to the content of a post after it is retrieved from the database and is "theme-safe".
* (i.e., Your changes will not be stored permanently or impact the HTML output in other themes.)
*
@jordelver
jordelver / gist:4352220
Created December 21, 2012 11:18
Move a deprecated gem into vendor/gems

Move a deprecated gem into vendor/gems

If a gem gets pulled from rubygems.org, but you still have it locally (or can get hold of it somehow), you can move the gem into your vendor/gems directory.

Unpack the gem into vendor/gems

gem unpack <gem-name> --target vendor/gems

Edit the Gemfile to match

@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………