Skip to content

Instantly share code, notes, and snippets.

Avatar
🦑
🦖

SeanJA SeanJA

🦑
🦖
View GitHub Profile
@SeanJA
SeanJA / dashboard.erb
Created Nov 11, 2012
disqus comment count widget for dashing
View dashboard.erb
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="disqus_comments" data-view="Number" data-title="Comments" data-moreinfo="This Month" style="background-color:#427EB4;"></div>
<i class="icon-comments icon-background"></i>
</li>
@SeanJA
SeanJA / Gemfile
Created Nov 6, 2012
pageviews widget for dashing
View Gemfile
gem 'garb', :git => 'git://github.com/Sija/garb.git'
View fancy-hr.css
hr.✁ {
border-style: dashed;
border-width: 3px 0 0;
height: 2px;
margin-top: 20px;
width: 90%;
}
hr.✁:before {
content: "\2701"; /* snip */
display: block;
@SeanJA
SeanJA / jquery.referrer.js
Created Oct 5, 2012 — forked from gavinblair/jquery.referrer.js
Get the referrer with jQuery: A useless bookmarklet
View jquery.referrer.js
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.7.2",function($,L){$.fn.referrer%20=%20function()%20{%20%20%20%20return%20$(document).prop("referrer").toString();};alert($().referrer());});
@SeanJA
SeanJA / jquery.referrer.js
Created Oct 3, 2012
Get the referrer in jQuery
View jquery.referrer.js
jQuery.fn.referrer = function() {
return jQuery(document).prop("referrer").toString();
};
//usage:
jQuery().referrer()
View tabs_might_disappear_better_be_sure_they_are_still_there.php
<?php if ($tabs): print '<div id="tabs-wrapper" class="clear-block">';
endif; ?>
<?php if ($tabs): ?>
<div id="drupal-control-bar">
<?php endif; ?>
<?php if ($tabs): print '<ul>' . $tabs . '</ul>';
endif; ?>
<?php if ($tabs2): print '<ul class="tabs secondary">' . $tabs2 . '</ul>';
endif; ?>
@SeanJA
SeanJA / sunburst.sass
Created Sep 21, 2012
Sunburst mixin for sass
View sunburst.sass
@mixin sunburst($color) {
$color2: darken($color, 15%);
background: -webkit-gradient(linear, 90deg, 90deg, color-stop(50%, transparent), color-stop(50%, $color2), color-stop(100%, $color2)),
-webkit-gradient(linear, 82deg, 82deg, color-stop(50%, transparent), color-stop(50%, $color), color-stop(100%, $color)),
-webkit-gradient(linear, 67deg, 67deg, color-stop(50%, transparent), color-stop(50%, $color2), color-stop(100%, $color2)),
-webkit-gradient(linear, 52deg, 52deg, color-stop(50%, transparent), color-stop(50%, $color), color-stop(100%, $color)),
-webkit-gradient(linear, 37deg, 37deg, color-stop(50%, transparent), color-stop(50%, $color2), color-stop(100%, $color2)),
-webkit-gradient(linear, 22deg, 22deg, color-stop(50%, transparent), color-stop(50%, $color), color-stop(100%, $color)),
-webkit-gradient(linear, 7deg, 7deg, color-stop(50%, transparent), color-stop(50%, $color2), color-stop(100%, $color2)),
-
@SeanJA
SeanJA / better.php
Created Aug 7, 2012
I heard you like switches
View better.php
<?php
function my_module_nodeapi(&$node, $op, $teaser, $page){
$func = 'my_module_nodeapi_'.$node->type.'_'.$op;
if(function_exists($func)){
$func(&$node, $teaser, $page);
}
}
@SeanJA
SeanJA / gist:3041858
Created Jul 3, 2012
drupal equivalent
View gist:3041858
SELECT COUNT(*)
FROM table_1
JOIN table_2 ON (table_1.id=table_2.table_1_id)
WHERE table_1.column != 'foo'
<?php
//query_builder
$q = new query($db);
$q->column('COUNT(*)')
View gist:2953803
C:\Users\Sean\Dropbox\nodejs\node_modules\sqlite3\build\deps\sqlite3\sqlite3.vcxproj(1,682): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
ERR! Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
at ChildProcess.onExit (C:\Users\Sean\Dropbox\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:209:23)
at ChildProcess.emit (events.js:70:17)
at maybeExit (child_process.js:362:16)
at Process.onexit (child_process.js:398:5)
ERR! not ok
npm ERR! sqlite3@2.1.3 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1