Skip to content

Instantly share code, notes, and snippets.

View dbergey's full-sized avatar
🙃

Diana Bergey dbergey

🙃
View GitHub Profile
// from: http://forum.jquery.com/topic/jquery-reading-comments-from-the-dom
jQuery.fn.comments = function(location) {
var location = location || "inside";
var comments = [];
this.each(function() {
if (location == "inside") {
var children = this.childNodes
for (var i = 0; i < children.length; i++) {
var child = children[i];
<pre><?php
$herp = true;
$derp = false;
echo "$herp\n"; // --> 1
echo "$derp\n"; // --> [NOTHING]
?></pre>
@dbergey
dbergey / gist:1439654
Created December 6, 2011 19:50
Browser-Specific Classes
// add OS-specific classes for targeting a whole set of browser on one OS.
$('html').addClass('browser-os-'+ (
navigator.userAgent.match(/Macintosh/) ? 'macos' :
navigator.userAgent.match(/Windows/) ? 'windows' :
navigator.userAgent.match(/Linux/) ? 'linux' :
'unknown')
)
// now add more general browser classes for targeting all version of any one browser. IE disabled since conditional comments added.
.addClass('browser-'+ (
$.browser.msie ? 'ie' :
if (type == 'blah')
var conditionalArea = {
stuff: "nonsense"
};
else {
var conditionalArea = {
fillColor: {
linearGradient: [0, 0, 0, 300],
stops: [
[0, Highcharts.getOptions().colors[0]],
@dbergey
dbergey / gist:2695699
Created May 14, 2012 18:56
don't switch chat tabs when switching to chat app
tell application "System Events"
if (count of (every application process whose name is "iChat")) > 0 then
activate application "iChat"
else
activate application "Adium"
end if
end tell

Keybase proof

I hereby claim:

  • I am dbergey on github.
  • I am dbergey (https://keybase.io/dbergey) on keybase.
  • I have a public key ASBfG5XPjljGmWg9kwbljH3cC5_9VUb4cgrlDitDDcJJKwo

To claim this, I am signing this object: