Skip to content

Instantly share code, notes, and snippets.

Andy Fowler andyfowler

Block or report user

Report or block andyfowler

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
metar='curl -s -d "station_ids=karb,kozw,kyip,kdtw,ktol,kttf,klan,kjxn,kgrr" | egrep -o "[A-Z]{4} [0-9]{6}Z.+" | sed '\''s/<\/FONT><BR>//'\'
andyfowler / mixins.css
Created Nov 16, 2010
Used in less.js
View mixins.css
/* ===================================== */
/* = Some less.js mixins from Nutshell = */
/* ===================================== */
.rounded-corners (@radius: 5px) {
border-radius: @radius;
-moz-border-radius: @radius;
-webkit-border-radius: @radius;
.drop-shadow (@x:0, @y:1px, @feather:1px, @color:#fff) {
andyfowler / less-example.css
Created Nov 16, 2010
A sample of some CSS, written for less.js
View less-example.css
@import 'mixins.less';
nav {
ul {
list-style: none;
li {
float: left;
color: @tan;
andyfowler / random-time-from-range.sql
Created Nov 2, 2010
Generate a random SQL time from a given range. For generating lots of fake data.
View random-time-from-range.sql
UNIX_TIMESTAMP('2010-12-30 15:00:00') -
UNIX_TIMESTAMP('2010-10-25 12:00:00')) +
UNIX_TIMESTAMP('2010-10-25 12:00:00')
View instance_name.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Call class="org.mortbay.log.Log" name="info"><Arg>Configure INSTANCE_NAME.xml</Arg></Call>
<Set name="contextPath">/instance_name</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/solr.war</Set>
<Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
View override_instance_name.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
View jetty.xml
<Call name="addLifeCycle">
<New class="org.mortbay.jetty.deployer.ContextDeployer">
<Set name="contexts"><Ref id="Contexts"/></Set>
<Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>
<Set name="scanInterval">1</Set>
View animate-sprite-loop.js
window.setInterval(function() {
var position = element.css('background-position'),
positionX = Math.abs($.nounit(position.split(' ')[0])),
positionY = position.split(' ')[1],
frameWidth = 66,
numFrames = 8,
currentFrame = Math.floor(positionX / frameWidth),
nextFrame, nextFrameOffset;
nextFrame = (currentFrame == (numFrames - 1)) ? 0 : currentFrame + 1;
# ideal for textmate bundle, reloads the current tab's CSS
# JS via
refreshScript=`cat <<'JAVASCRIPT'
void(function(){var i,a,s;a=document.getElementsByTagName('link');for(i=0;i<a.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href) {var h=s.href.replace(/(&|\\\?)forceReload=\\\d+/,'');s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new Date().valueOf())}}})();
# Check if Safari is running, if so refresh CSS
ps -xc|grep -sq Safari && osascript <<APPLESCRIPT
View gist:441010
# import a directory into a case-sensitive DMG
hdiutil create -srcfolder "${dir}" -autostretch -fs JHFS+X temp.dmg
hdiutil attach -mountpoint "${dir}-caseSensitive" temp.dmg
# JHFS+X == journalled, case-sensitive.
# DMG is initially the directory size, but can grow as needed
You can’t perform that action at this time.