Skip to content

Instantly share code, notes, and snippets.

@sevenbest
sevenbest / DefaultCSS_Markdown.css
Last active March 5, 2016 19:55 — forked from splorp/DefaultCSS_Markdown.css
A default stylesheet based on GitHub’s Markdown formatting for use with BBEdit’s Preview CSS feature.
body {
background-color: #FFF;
color: #333;
font: 15px Helvetica, arial, freesans, clean, sans-serif;
word-wrap: break-word;
line-height: 1.7;
padding: 0 20px 20px 20px;
max-width: 722px;
margin: auto;
-webkit-font-smoothing: antialiased;
@sevenbest
sevenbest / new_gist_file_0
Created November 29, 2013 15:08
JavaScript: Vertical Align
// taken from ink eb website, our-partners pages. parent-count is a class added just to count the number of elements.
$(window).load(function () {
for (var i = $('.parent-count').length; i >= 0; i--) {
var parentHeight = $('#parent-' + i).height();
var childHeight = $('#child-' + i).height();
$('#child-' + i).css('margin-top', (parentHeight - childHeight) / 2);
};
});
@sevenbest
sevenbest / 0_reuse_code.js
Created November 29, 2013 09:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sevenbest
sevenbest / gist:6794195
Created October 2, 2013 13:56
Less: Custom Bullet
ul {
list-style: none;
margin-left: 0;
li {
background: url('/_/img/custom-bullet.png') no-repeat 0 0;
padding-left: 17px;
margin-bottom: 10px;
}
}
@sevenbest
sevenbest / base.less
Last active December 24, 2015 11:39
Less: Base
.no-link-styles(@color: inherit) {
color: @color;
&:hover {
text-decoration: none;
color: @color;
}
}
.no-link-styles-with-underline(@color: inherit) {
@sevenbest
sevenbest / gist:6778706
Last active December 24, 2015 09:39
PHP: Custom Twitter Link
<?php
$encoded_url = urlencode('http://' . 'www.' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
$text = "&text=" . "here's a great link:";
$twitter_string = $encoded_url . $text;
?>
<!-- Note that .dev domains will not be linked to in twitter, but changing to something like '.com' will work -->
<div id="custom-tweet-button">
<a href="https://twitter.com/share?url=<?php echo $twitter_string; ?>" onclick="return !window.open(this.href, '_blank', 'width=500,height=500')">Tweet</a>