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 / 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;
}
@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 / 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
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 / .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:
@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 / gist:d258bbae7f40fa0132ba
Created August 1, 2014 17:16
round number to the nearest 5 or 9
def round_price(price)
amount = price.ceil()
if amount % 10 < 5
amount = amount + 5 - (amount % 5)
else
amount = amount + 9 - (amount % 9)
end
amount
{
"bold_folder_labels": true,
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
"fade_fold_buttons": false,
"file_exclude_patterns":
[
".DS_Store",
".gemtags",
".gitkeep",
".tags",
var elements = document.getElementsByClassName('js-unfollow')
for(var i=0; i<elements.length; i++) {
elements[i].click()
}