Skip to content

Instantly share code, notes, and snippets.

View jimmynotjim's full-sized avatar
☀️
Enjoying SoCal "Fall"

Jimmy Wilson jimmynotjim

☀️
Enjoying SoCal "Fall"
View GitHub Profile
@jimmynotjim
jimmynotjim / directions
Created May 4, 2012 00:16
Animated Scrolling
Add a class of .scrollPage to any trigger link on the page and script will run when the link is clicked.
@jimmynotjim
jimmynotjim / gist:2663844
Created May 12, 2012 02:54 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@jimmynotjim
jimmynotjim / readme
Created May 23, 2012 01:50
Simple Clean JS script to create Faux Small Caps
I needed to create some faux small caps that were only slightly smaller than the full cap. Font-variant was too drastic so instead I wrapped each word in a <span> set the span to inline-block and used :first-letter to increase the font-size of the first letter in each word.
@jimmynotjim
jimmynotjim / readme
Created May 25, 2012 00:47
jQuery script to equalize the sidebar and content of a page
Simple jQuery script to set a sidebar to always span the height of a page. Required when the sidebar has a background, borders, or shadows. #main is the container for both the sidebar and content and can be replaced w/ any other element. It's important to use min-height, in case your sidebar has moving/changing elements that could resize it larger than the main content (or just happens to be larger than the main content).
@jimmynotjim
jimmynotjim / custom-list.less
Created June 14, 2012 17:03
Custom Ordered List Mixins in LESS
// This is a snipit from a post I wrote up detailing the process. Check it out if you want to learn more
// https://jimmynotjim.snipt.net/create-a-custom-ordered-list-in-css-and-sass/
// Basic mixin to prefix each li w/ it's list number
.custList {
counter-reset: item;
list-style: none;
& > li {
&::before {
@jimmynotjim
jimmynotjim / custom-list.scss
Created June 14, 2012 17:04
Custom Ordered List Mixins in SCSS
// This is a snipit from a post I wrote up detailing the process. Check it out if you want to learn more
// https://jimmynotjim.snipt.net/create-a-custom-ordered-list-in-css-and-sass/
// Basic mixin to prefix each li w/ it's list number
@mixin custList {
counter-reset: item;
list-style: none;
& > li {
&::before {
@jimmynotjim
jimmynotjim / Description
Created July 25, 2012 18:25
WP Meta Box
I'm trying to get this reusable Meta Box to work, but when I include the cases for each type it breaks my entire site returning a server error. Any ideas what I'm doing wrong? The code is from this post http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-1-intro-and-basic-fields/
@jimmynotjim
jimmynotjim / gist:3291471
Created August 8, 2012 02:15
Another equal height columns script
// equalize height for content area with sidebar
var equalize = Math.max(
$('.main').height(),
$('.sidebar').height()
);
$('.content').height(equalize);
@jimmynotjim
jimmynotjim / gist:3426896
Created August 22, 2012 15:42
Often used scripts in WP Enqueue
/* BEGIN: Scripts
---------------------------------------------------------------------------------------------------- */
function load_my_scripts() {
// Latest JQuery
wp_deregister_script( 'jquery' );
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
wp_enqueue_script('jquery');
@jimmynotjim
jimmynotjim / index.html
Created August 28, 2012 14:13
Couldn't sleep so I ported my buddy Fyza's latest dribbble shot to css.
<div class="single-title">
<a href="http://dribbble.com/14eleven"><img src="http://dribbble.s3.amazonaws.com/users/4950/avatars/original/image.jpeg?1336502746" /></a>
<h1>Orange Ribbon Logo</h1>
<div class="byline">
<span class="author">by <a href="http://dribbble.com/14eleven">Fyza Hashim</a></span>
<span class="post-date">Aug 27, 2012</span>
</div>
</div>
<a href="http://dribbble.com/shots/705097-Orange-Ribbon-Logo"><div class="shot"><span>Awesome</span><span>Website</span><span>Title</span></div></a>