Skip to content

Instantly share code, notes, and snippets.

View mshirdel's full-sized avatar
🏠
Working from home

Meysam Shirdel mshirdel

🏠
Working from home
View GitHub Profile
#!/bin/bash
# this script is not written by me. Just using it and sharing it here.
# export DBUS_SESSION_BUS_ADDRESS environment variable useful when the script is set as a cron job
PID=$(pgrep gnome-session)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
# $bing is needed to form the fully qualified URL for
# How to find out where a method comes from.
# Learned this from Dave Thomas while teaching Advanced Ruby Studio
# Makes the case for separating method definitions into
# modules, especially when enhancing built-in classes.
module Perpetrator
def crime
end
end
class Fixnum
@mshirdel
mshirdel / FontRegEx
Last active August 29, 2015 14:21 — forked from siwells/gist:1114395
RegEx for replacing font tag
/*
* Clear the highlighting to allow the user to toggle
* between the original page & the highlighted page.
*/
function clearHighlighting()
{
alert("clearing hightlighting...");
if (!document.body || typeof(document.body.innerHTML) == "undefined") {
if (warnOnFailure) {