Skip to content

Instantly share code, notes, and snippets.

module Sass::Script::Functions
def user_color
color_values = options[:custom][:user].color.
scan(/^#?(..?)(..?)(..?)$/).first.
map {|num| num.ljust(2, num).to_i(16)}
Sass::Script::Color.new(color_values)
end
end
@Grawl
Grawl / dabblet.css
Created January 18, 2012 00:48
CSS triangle with border
/**
* CSS triangle with border
*/
html,
body {
height: 100%;
}
body {
padding: 10px 30px 0;
background: linear-gradient(45deg, pink , blue) 100% 100% no-repeat;
module Sass::Script::Functions
def absolute_path(path = nil)
Sass::Script::String.new([Compass.configuration.http_path, path].compact.join("/"))
end
end
@kix
kix / cap.rb
Created October 5, 2012 08:04
Capistrano cheat sheet
http://www.dizzy.co.uk/cheatsheets
This work is licensed under the Creative Commons
Attribution-NonCommercial-NoDerivs 2.0 License. To
view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-nd/2.0/uk
########## Shell Commands ##########
Installation:
$ gem install capistrano
//
// Sass rotation mixin for IE6+
//
@mixin ms-rotate($degrees) {
@if (not unitless($degrees)) { $degrees: $degrees / 1deg }
$deg2rad: pi() * 2 / 360;
$radians: $degrees * $deg2rad;
$costheta: cos($radians);
$sintheta: sin($radians);
@cheapsteak
cheapsteak / gist:5205777
Last active December 15, 2015 04:59 — forked from radiosilence/gist:4040553
Zurb Foundation 4 Shim for RequireJS.
/**
* You might want to change baseUrl to something else depending on where your require.js is.
* If you want to do conditional loading of Zepto, take a look at the discussion at
* https://groups.google.com/forum/?fromgroups=#!topic/requirejs/68oIXcyou48
* Had to add explicit paths for each plugin, otherwise `require` tries to look for it in
* /foundation/foundation/foundation.alerts.js
*/
require.config({
baseUrl: "js",
@radiosilence
radiosilence / gist:4040553
Created November 8, 2012 18:19
RequireJS with Zurb Foundation
requirejs.config({
shim: {
'foundation/jquery.foundation.topbar': {
deps: ['jquery'],
},
'foundation/jquery.cookie': {
deps: ['jquery']
},
'foundation/jquery.event.move': {
deps: ['jquery']
@pjkix
pjkix / css-stats-ack.sh
Created October 5, 2011 21:39
shell script to generate some css file statistics
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@awshout
awshout / foundation4-topbar-menu.php
Last active August 19, 2023 02:44
WordPress Menu & Walker for ZURB's Foundation 4 Top Bar
<?php
add_theme_support('menus');
/**
* Register Menus
* http://codex.wordpress.org/Function_Reference/register_nav_menus#Examples
*/
register_nav_menus(array(
'top-bar-l' => 'Left Top Bar', // registers the menu in the WordPress admin menu editor
'top-bar-r' => 'Right Top Bar'