Skip to content

Instantly share code, notes, and snippets.

View jimmyhillis's full-sized avatar

Jimmy Hillis jimmyhillis

View GitHub Profile
@jimmyhillis
jimmyhillis / shareurls.php
Created April 29, 2014 06:06
Share URL strings from variables
<?php
$tweet_url = 'http://twitter.com/intent/tweet'
. '?text=' . urlencode($PAGE_TITLE)
. '&url=' . urlencode($PAGE_URL)
. '&via=' . $TWITTER_UN;
$facebook_url = 'https://www.facebook.com/dialog/feed'
. '?app_id=' . urlencode(FACEBOOK_APP_ID)
. '&link=' . urlencode($PAGE_URL)
. '&name=' . urlencode($PAGE_TITLE)
@jimmyhillis
jimmyhillis / tracker.js
Last active August 29, 2015 13:56
A google analytics wrapper for safe callbacks and tracking
var Tracker = (function () {
var Tracker = function (options) {
options = options || {};
this.debug = options.debug || false;
this.timeout = options.timeout || 600;
return this;
};
Tracker.prototype.send = function (type, post) {
@jimmyhillis
jimmyhillis / keybindings.md
Last active April 17, 2024 08:39
iTerm 2 Mac-ready key binding additions.

Standard bindings

  • Move left between words: ⌥← | send escape sequence | b
  • Move right between words: ⌥→ | send escapes sequence | f
  • Start of the line: ⌘← | send escape sequence | [H
  • End of the line ⌘→ | send escape sequence | [F
  • Delete previous word ⌥←Delete | send hex code | 0x1B 0x08
  • Delete entire line ⌘←Delete | send hex code | 0x15

Don't forget the amazing icons ⌘ = command and ⌥ = options/alt (why oh why?).

@jimmyhillis
jimmyhillis / deform-bootstrap.html
Created November 27, 2013 06:00
Basic HTML markup from Deform using `deform_bootstrap` -- the standard set of skins within Kotti. Contains a single button, input text, textarea, select, checkbox radio and checkbox group.
<form id="deform"
class="deform form-horizontal deform ng-pristine ng-valid"
action=""
method="post"
enctype="multipart/form-data"
accept-charset="utf-8"
name="deform">
<!-- Hidden inputs and alerts at the top -->
<input type="hidden"
name="_charset_" /> <input type="hidden"
@jimmyhillis
jimmyhillis / gallery-zoom.html
Created August 19, 2013 02:37
Zoom function to increase the size of the image responsively within it's container element at the correct height position.
@jimmyhillis
jimmyhillis / gist:6034952
Created July 19, 2013 03:41
Indirect allows you to return a list of elements from selectors found within a set of elements from a selector. It's pointers for jQuery, which can be very useful when dealing with filtering and categorizing event actions like showing/hiding relating navigation elements for mobile.
/**
* Indirect returns elements found by the called selector within the
* provided attribute.
*
* > <a href="#" class="show-menu" data-show-navigation=".main-navigation">
* > $('.show-menu').indirect('[data-show-navigation]')
*
* This will return the equivalent of calling $('.main-navigation') which
* allows you to indirectly find a list of elements from a set of
* existing "pointer" elements.
@jimmyhillis
jimmyhillis / commacommaand.py
Created June 19, 2013 09:04
This function returns a list of items with the comma, comma & format for a list of strings.
def commacommaand(items):
return ', '.join(items)[::-1].replace(',', '& ', 1)[::-1]
@jimmyhillis
jimmyhillis / index.html
Created May 17, 2013 08:14
A CodePen by Burak Can. CSS only 3d Macbook Air - No-js :) Just for fun and practice
<div class="macbook">
<div class="inner">
<div class="screen">
<div class="face-one">
<div class="camera"></div>
<div class="display">
<div class="shade"></div>
</div>
<span>MacBook Air</span>
</div>
@jimmyhillis
jimmyhillis / index.html
Created May 17, 2013 08:14
A CodePen by Burak Can. CSS only 3d Macbook Air - No-js :) Just for fun and practice
<div class="macbook">
<div class="inner">
<div class="screen">
<div class="face-one">
<div class="camera"></div>
<div class="display">
<div class="shade"></div>
</div>
<span>MacBook Air</span>
</div>
@jimmyhillis
jimmyhillis / facebook-tab-height.js
Created February 19, 2013 01:46
Remove the default height restriction from Facebook iFrame tabs with a simple JavaScript callback run as soon as the Facebook SDK is initialized.
window.fbAsyncInit = function() {
FB.init({
appId: '415273505232476',
status: true,
cookie: true,
xfbml: true
});
FB.Canvas.setAutoGrow();
};
// Load the SDK Asynchronously