Skip to content

Instantly share code, notes, and snippets.

View SebAshton's full-sized avatar
🍰
Eating Cake

Seb Ashton SebAshton

🍰
Eating Cake
View GitHub Profile
@SebAshton
SebAshton / build_email.sh
Created July 18, 2014 18:18
A shell script to inline html styles from a static html page. requires premailer.
#!/usr/bin/env ruby
require "premailer"
require "optparse"
OptionParser.new do |o|
o.on('-d OUTPUT_FOLDER') { |b| $destination = b }
o.on('-o OUTPUT_FILENAME') { |b| $output = b }
o.on('-f INPUT_FILENAME') { |filename| $filename = filename }
o.on('-h') { puts o; exit }
@SebAshton
SebAshton / .scss-lint.yml
Created July 16, 2014 08:24
SCSS Lint config example
# https://github.com/causes/scss-lint/tree/master/lib/scss_lint/linter
exclude: 'app/assets/stylesheets/settings/*'
linters:
BorderZero:
enabled: true
ColorKeyword:
enabled: false
Comment:
def remote_file_exists?(url)
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http = Net::HTTP.new(uri.host, uri.port)
if uri.scheme == 'https'
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
end
@SebAshton
SebAshton / partial-search.sh
Created June 23, 2014 09:35
CLI Improvements
#Add this to ~/.inputrc to enable partial searching of bash history with arrow keys
## arrow up
"\e[A":history-search-backward
## arrow down
"\e[B":history-search-forward
@SebAshton
SebAshton / scrollbar.scss
Last active August 29, 2015 14:02
css scrollbar mixin
@mixin scrollbar($pill-color = "#000") {
overflow-x: hidden;
overflow-y: auto;
scrollbar-face-color: $pill-color;
scrollbar-arrow-color: $pill-color;
scrollbar-track-color: transparent;
scrollbar-shadow-color: $pill-color;
scrollbar-highlight-color: $pill-color;
scrollbar-3dlight-color: $pill-color;
scrollbar-darkshadow-Color: $pill-color;
@SebAshton
SebAshton / letter-spacing.scss
Created April 14, 2014 17:41
Convert PSD tracking to css letter spacing. This is an approximation at best.
@mixin psd-letter-spacing($tracking) {
letter-spacing: ($tracking / 1000) * 1em;
}
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
width="350px" height="337px" viewBox="0 0 350 337" enable-background="new 0 0 350 337">
<path d="M175,0C78.35,0,0,75.44,0,168.5C0,261.561,78.35,337,175,337c96.648,0,175-75.439,175-168.5C350,75.44,271.649,0,175,0zM74.335,233.809c-13.046-18.656-20.662-41.125-20.662-65.31c0-64.665,54.444-117.087,121.604-117.087c23.469,0,45.378,6.407,63.96,17.495l-80.597,81.999l-0.016,69.188l-3.125,1.031l-36.429-32.053l-20.125,20.125l0.023,11.082
l-11.148,0.043L74.335,233.809z M175.277,285.587c-23.613,0-45.649-6.487-64.306-17.702l75.832-75.83c-2.675-7.136-4.169-17.584-4.169-24.188c0-20.694,13.308-51.532,51.01-51.532c8.807,0,17.646,2.264,23.783,5.095l18.563-18.564c13.187,18.721,20.892,41.311,20.892,65.635C296.882,233.166,242.438,285.587,175.277,285.587z"/>
<path fill="#EE1C4E" d="M76.733,118.809l57.972,51.309v-50.034h22.678v99.501l-1.56,0.567l-57.829-51.876v51.026h-22.82v-99.926L76.733,118.809z"/>
<path fill="#EE1C4E" d="M282.827,169.551c0,21.262-11.622,51.
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="350px" height="337px" viewBox="0 0 350 337" enable-background="new 0 0 350 337" xml:space="preserve">
<g>
<path d="M175,0C78.35,0,0,75.44,0,168.5C0,261.56,78.35,337,175,337c96.649,0,175-75.44,175-168.5C350,75.44,271.649,0,175,0z
M74.335,233.809c-13.046-18.657-20.662-41.126-20.662-65.31c0-64.665,54.444-117.087,121.604-117.087
c23.468,0,45.378,6.407,63.96,17.495l-80.597,81.999l-0.016,69.188l-3.125,1.031l-36.428-32.053l-20.125,20.125l0.023,11.082
l-11.148,0.043L74.335,233.809z M175.277,285.587c-23.614,0-45.65-6.487-64.306-17.702l75.832-75.831
@SebAshton
SebAshton / gist:7167923
Last active December 26, 2015 14:48
proper numbering of nested ol's
<!doctype html>
<html lang="en">
<head>
<title>Nested ol numbering</title>
<style>
ol {
list-style-type: none;
counter-reset: level1;
}
ol li:before {
@SebAshton
SebAshton / github-badges.md
Last active September 28, 2018 01:09
Available Github Badges
Badge Description Free for OSS Languages
Coveralls Code Coverage Yes Ruby, Python, PHP, Node, C/C++, Java, Scala, Go
Gemnasium Dependancy Monitoring Yes Ruby (RubyGems), Node (NPM)
Crate Num of Downloads ? Python
Brakeman Security Yes RoR
Code Climate Code Review Yes Ruby, Javascript
Version Badge Package Version Yes Ruby, Python, Node
Travis CI Continuous Integration Yes C/C++, Clojure, Erlang, Go, Groovy, Haskell, Java, Jav