Skip to content

Instantly share code, notes, and snippets.

View co2bo's full-sized avatar

Mathias Davidheimann co2bo

  • Germany, Colony of the United States
View GitHub Profile
@co2bo
co2bo / pack-css.coffee
Created April 5, 2019 11:46 — forked from pyrocat101/pack-css.coffee
Compress CSS and convert linked images into data URIs. Suitable for HTML inlining and optimize HTTP requests.
embedImages = (cssPath) ->
imgRegex = /url\s?\(['"]?(.*?)(?=['"]?\))/gi
css = fs.readFileSync cssPath, 'utf-8'
while (match = imgRegex.exec css)
imgPath = path.join path.dirname(cssPath), match[1]
try
img = fs.readFileSync imgPath, 'base64'
ext = imgPath.substr imgPath.lastIndexOf('.') + 1
css = css.replace match[1], "data:image/#{ext};base64,#{img}"
catch e
{
"always_show_minimap_viewport": false,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Tomorrow-Night-Eighties (SL).tmTheme",
"create_window_at_startup": false,
"default_encoding": "UTF-8",
"detect_indentation": true,
"draw_indent_guides": true,
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": false,
@co2bo
co2bo / .zshrc
Last active February 6, 2017 22:01
export ZSH="${HOME}/.oh-my-zsh"
#
# Theme
#
# ZSH_THEME="nicoulaj"
ZSH_THEME="bullet-train"
#
# Less
#
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
=linear-gradient($direction, $color-stops...)
@if is-direction($direction) == false
$color-stops: $direction, $color-stops
$direction: 180deg
background: nth(nth($color-stops, 1), 1)
background: -webkit-linear-gradient(legacy-direction($direction), $color-stops)
background: linear-gradient($direction, $color-stops)
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#{nth(nth($color-stops, 1), 1)}', endColorstr='#{nth(nth($color-stops, length($color-stops)), 1)}', GradientType=0 )
@function is-direction($value)
<!-- Slider -->
<div class='wrapper'>
<div class='header'>
<div class='bg bg-1'></div>
<div class='bg bg-2'></div>
<div class='bg bg-3'></div>
</div>
</div>
{
"bold_folder_labels": true,
"close_windows_when_empty": true,
"color_scheme": "Packages/User/SublimeLinter/InspiredGitHub (SL).tmTheme",
"create_window_at_startup": true,
"detect_indentation": false,
"draw_indent_guides": true,
"ensure_newline_at_eof_on_save": false,
"fade_fold_buttons": false,
"file_exclude_patterns":
## See http://help.github.com/ignore-files/ for more about ignoring files.
## If you find yourself ignoring temporary Files generated by your Text Editor
## or Operating System, you probably want to add a global ignore instead:
## Ignore Bundler Config
/.bundle
## Ignore the Build Directory
/build
@co2bo
co2bo / dev
Created January 17, 2017 04:27
defaults write com.apple.finder AppleShowAllFiles YES && \
killall Finder
defaults write com.apple.finder AppleShowAllFiles NO && \
killall Finder
<!doctype html>
<html class='no-js' lang='<%= I18n.locale %>'>
<head>
<meta charset='UTF-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
?!!?
<meta name='viewport' content='width=device-width, initial-scale=1.0, minimum-scale=1.0'>
<meta name='google-site-verification' content='<%= page_verify %>'>
<!-- Title -->
<title><%= page_title %></title>
@co2bo
co2bo / reinstall_mac.md
Created December 16, 2016 04:29 — forked from isccarrasco/reinstall_mac.md
Reinstallation of Mac