Skip to content

Instantly share code, notes, and snippets.

View sullenfish's full-sized avatar

Fred Ostrander sullenfish

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sullenfish on github.
  • I am sullenfish (https://keybase.io/sullenfish) on keybase.
  • I have a public key ASAi-1WQXFnXHAixpbhyrSMvCx15kSu-xjHnIkwGNv-gRQo

To claim this, I am signing this object:

@sullenfish
sullenfish / only-text.js
Last active August 29, 2015 13:57
jQuery :only-text Pseudo-Class
jQuery.expr[":"]["only-text"] = function (elem) {
var i = elem.childNodes.length - 1, flag = false;
for (; i >= 0; i -= 1){
switch (elem.childNodes[i].nodeType){
case 3: // 3: TEXT_NODE
flag = true;
break;
case 7: // 7: PROCESSING_INSTRUCTION_NODE
case 8: // 8: COMMENT_NODE
break;
@sullenfish
sullenfish / gray.styl
Last active August 29, 2015 13:56
Polyfill gray() from CSS Color Level 4 with Stylus
/* Based on "Polyfill gray() from CSS Color Level 4 with SASS"
* by Lea Verou
* with revisions by Chris Eppstein
* https://gist.github.com/LeaVerou/9199277
*/
gray(intensity, alpha = 1)
rgba(intensity, intensity, intensity, alpha)
/* Testing our new function */
@sullenfish
sullenfish / gist:6422876
Created September 3, 2013 11:55
Output only the results of npm -g outdated via the_silver_searcher in zsh.
# asynch
npm -g outdated 2>>(ag --nocolor '^((?!npm http).)*$')
# synch
{ { npm -g outdated 1>&3 } 2>&1 | ag --nocolor '^((?!npm http).)*$' } 3>&1
@sullenfish
sullenfish / gist:1186020
Created September 1, 2011 11:55
SavePDF Macro
Option Explicit
Public Sub SavePDF(Optional ExportLocation As String, _
Optional AskForDestination As Boolean = False, _
Optional OpenAfterExport As Boolean = False)
'
' SavePDF Macro
'
' GetFolder based on original code from: http://www.mrexcel.com/forum/showthread.php?t=294728
' TrimToChar based on original code from: http://www.cpearson.com/excel/sizestring.htm
@sullenfish
sullenfish / reload.bash
Created March 28, 2011 12:29 — forked from appden/reload.bash
bash profile reload via Scott Kyle (aka appden)
# put this in your bash profile (change the line below if you use .bash_profile)
# refresh profile on USR1 signal
trap 'eval $(PATH= /usr/libexec/path_helper -s) && source ~/.profile' USR1
# send USR1 signal to all bash instances
reload() {
ps -xo pid,command | grep ' \-bash' | awk '{print $1}' | while read pid; do
kill -USR1 $pid
done
@sullenfish
sullenfish / gist:857954
Created March 7, 2011 01:49
Basic Page Structure - XHTML 1.0 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title></title>
<style type="text/css"></style>
<link rel="stylesheet" type="text/css" href="" />
<script type="text/javascript" src=""></script>
<script type="text/javascript"></script>
</head>
<body>
@sullenfish
sullenfish / platform-cygwin.cc
Created December 30, 2010 16:08 — forked from piscisaureus/platform-cygwin.cc
V8 Workaround to Compile Node in Cygwin
// Copyright 2006-2008 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
<?php
$sSessionID = '8675309';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
<html>
<head>
<title>sullenfish.com</title>
</head>
<body bgcolor="#f5f5f5">
<p><font size="4">
<fieldset>"Sometimes when I'm suffering from writer's block what I like to do is watch a bunch of strangers from above and think about what their lives are probably like. Then, while I'm reloading, I jot down little notes that I can flesh out later."<br />
-Ken Dysland</fieldset></font></p>
<hr />
<div align="left">