Skip to content

Instantly share code, notes, and snippets.

View Shipow's full-sized avatar

Kevin Granger Shipow

View GitHub Profile
@redox
redox / base.html.haml
Last active May 16, 2020 13:13
Algolia extends HipChat to customer support
#chat-box.ubuntu.hidden-xs
.closed
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-chevron-up').html_safe, 'chat.show()'
.m-l-small
= link_to_function 'Chat with us', 'chat.show()'
.opened{style: 'display: none'}
.header
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-plus-sign').html_safe, 'chat.maximize()', class: 'maximize', style: 'display: none'
@subfuzion
subfuzion / redis-autostart-osx.md
Last active April 26, 2024 21:40
redis auto start OS X

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)

@Shipow
Shipow / robot.js
Created December 5, 2012 02:47
Shipow#001
var Robot = function(robot) {
robot.rotateCannon(-90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead();
//i'll add a clone but i need to refactor collision
//robot.clone();
};
@manuel-woelker
manuel-woelker / 1_readme.md
Created June 6, 2012 07:52 — forked from geelen/1_readme.md
Fiddling with Gists

Running Gists like a JsFiddle

TL;DR: This page (html, css, javascript, markdown) is being served from this gist using this server.

After working with AngularJS, which is totally awesome, I wanted a better way to share code snippets with the community. Something where the header declarations aren't hidden, so it's clear which version of angular you're using and whether zepto/jquery/underscore are loaded. I also wanted to use CoffeeScript, HAML and SCSS because that's what I use to write Goodfilms (my day job).

This HTML is being rendered from HAML, the CSS is being compiled from SCSS, the JS code is written in Coffeescript and even this here text is being compiled (in the browser) from a gist-hosted Markdown file.

@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
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

@mrdanadams
mrdanadams / _pems.scss
Created March 29, 2012 13:32
PX to EMs conversion in Sass
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */
/* Default font size in pixels if not overridden. */
$baseFontSize: 16;
/* Convert PX units to EMs.
Ex: margin-right: pem(16);
*/
@function pem($pxval, $base: $baseFontSize) {
@return #{$pxval / $base}em;
@html
html / gist:1698093
Created January 29, 2012 09:56
Sequential images loading with jquery
function eachStep(collection, callback, endcallback){
if(collection.length == 0){
return endcallback && endcallback();
}
jQuery.when(callback(collection[0])).always(function(){
eachStep(collection.slice(1), callback, endcallback);
});
}