Skip to content

Instantly share code, notes, and snippets.

View sgreenfield's full-sized avatar

Scott Greenfield sgreenfield

  • Omaha, NE
View GitHub Profile
@sgreenfield
sgreenfield / gist:2720910
Created May 17, 2012 18:58
Future bookmarklet to help with SASS color adjustments
var jsColor = {};
(function(self){
self.hexToRgb = function(hex) {
if (hex[0]=="#") hex=hex.substr(1);
if (hex.length==3) {
var temp=hex; hex='';
temp = /^([a-f0-9])([a-f0-9])([a-f0-9])$/i.exec(temp).slice(1);
for (var i=0;i<3;i++) hex+=temp[i]+temp[i];
}
@sgreenfield
sgreenfield / gist:2362751
Created April 11, 2012 21:24
ASCII Looks of Disapproval
ಠ_ಠ
ಠ~ಠ
ಠoಠ
ಠxಠ
ಠ.ಠ
@sgreenfield
sgreenfield / pull-it.js
Last active September 29, 2015 22:38
Quick and Dirty Bookmarklet for Github Pull Requests *** FF 20 Security prevents bookmarklets. about:config => security.csp.enable: false
javascript:(function(){var%20$commits=$('.commits-condensed%20td.message'),title=$.trim($commits.last().text())+'...',pullBody='';$commits.each(function(){pullBody+=$.trim($(this).text())+'%20%20';});$('.title.required').val(title);$('#pull_body').val(pullBody);$('.form-actions .button.primary').removeAttr('disabled');})();
@sgreenfield
sgreenfield / gist:1660133
Created January 23, 2012 02:41
Need this from the server...
//This is JavaScript object is an example of what I need returned from the server.
{
events: [
{
id: 1, userid: 1
},
{
id: 2, userid: 1
},
@sgreenfield
sgreenfield / gist:1557278
Created January 3, 2012 22:26
Compass font-face mixin
@mixin font-face(
$name,
$font-files,
$eot: false,
$weight: false,
$style: false
) {
$iefont: unquote("#{$eot}?iefix");
@font-face {
font-family: quote($name);
$(this).bind('mouseover focusin mouseleave blur', function(e){
e.stopImmediatePropagation();
})
.attr('title','')
.tooltip({
content: function(){ return IG.Tmpl.partials["schedules_quick_add"]; },
position: {
my: 'left bottom',
at: 'left top',
of: $(this),