Skip to content

Instantly share code, notes, and snippets.

View alexg0's full-sized avatar

Alexander Goldstein alexg0

  • Eligo Energy, LLC
  • Miami, FL
View GitHub Profile
@troy
troy / save-redfin-listing-images-bashrc
Created September 10, 2009 13:22
Given a redfin.com house listing URL, save all full-size images
# usage: redfin-images "http://www.redfin.com/WA/Seattle/123-Home-Row-12345/home/1234567"
function redfin-images() {
wget -O - $1 | grep "full:" | awk -F \" '{print $4}' | xargs wget -
}
$(document).ready(function() {
// Define the dateFormat for the datepicker
$.datepicker._defaults.dateFormat = 'dd M yy';
/**
* Sets the date for each select with the date selected with datepicker
*/
$('input.ui-date-text').live("change", function() {
var sels = $(this).siblings("select:lt(3)");
var d = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $(this).val() );
@calvincorreli
calvincorreli / exceptional_for_delayed_job.rb
Created November 24, 2010 11:02
Integrating Exceptional with https://github.com/collectiveidea/delayed_job - put this in config/initializers/
if !Exceptional::Config.api_key.nil? && Rails.env == 'production'
begin
class Delayed::Worker
def handle_failed_job_with_exceptional(job, error)
Exceptional.handle(error, "Delayed::Job #{self.name}")
handle_failed_job_without_exceptional(job, error)
Exceptional.context.clear!
end
alias_method_chain :handle_failed_job, :exceptional
Exceptional.logger.info "Lars Pind's custom DJ integration enabled"
class Module
# just like include except it makes sure to find all
# the modules that have already included self and
# update those features with the given module.
def include_hard(include_me)
include include_me
ObjectSpace.each_object(Module) do |some_module|
next unless some_module.included_modules.include?(self)
next if some_module.included_modules.include?(include_me)
some_module.class_eval { include include_me }
@redinger
redinger / Emacs.md
Created November 26, 2011 03:22
Setting up Emacs daemon on OS X

Setting up Emacs daemon on OS X

Tired of waiting for emacs to start on OS X? This step by step guide will teach you how to install the latest version of emacs and configure it to start in the background (daemon mode) and use emacsclient as your main editor.

Install Cocoa Emacs

Download the latest pretest version of [Emacs for Mac OS X]: http://emacsformacosx.com/builds

@douglasjarquin
douglasjarquin / amazon-linux.erb
Last active February 29, 2016 01:42 — forked from darrinholst/amazon-linux.erb
Chef bootstrap template for Amazon Linux
bash -c '
#
# make sure sudo users have the full path...
#
# sudo visudo
# Defaults env_keep += "PATH"
# Defaults !secure_path
#
@rodw
rodw / backup-github.sh
Last active May 31, 2024 23:23
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).
@walesmd
walesmd / IconServiceAgent.md
Last active December 13, 2023 05:06
A lot of people are having issues with com.apple.IconServicesAgent. Since this is a very new issue, Google was no help and `man iconservicesd` is even more hilarious. I eventually fixed it, when I was working on a completely different issue (that is still not fixed). The instructions are below and on the Apple Support Forum, https://discussions.…

I was chasing down another issue (slow "Save As") and thought these two issues may have been related (with QuickLook being the common broken link). Unfortunately, my "Save As" dialog is still miserably slow on the initial load; but IconServicesAgent hasn't gone above 30MB and he rarely makes an appearance in the Console!

Some of these steps may not be necessary, but here are all of the steps I took that inadverdently put IconServicesAgent back in its place. Note: all commands are a single-line, if they appear to be multiple that's just the forum formatting.

  1. Check for any QuickLooks related .plist files. In a terminal: mdfind com.apple.quicklook. -name .plist

  2. I only had files at the system level (specifically within /System/Library/LaunchAgents/). If you have others, modify the directions below to take that into account (re-introducing plist files from the system level back up to the user).

  3. Make some temporary directories to store these plist files, just in case: mkdir ~/tmp-quicklook

@bitops
bitops / hipchat.el
Last active November 14, 2019 20:09
HipChat + jabber.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; use jabber-connect to connect. Make sure you tab to select the hipchat account if it's the ;;
;; only connection configured. ;;
;; ;;
;; a fork of https://gist.github.com/puffnfresh/4002033 ;;
;; ;;
;; shout out to http://emacs.stackexchange.com/questions/10940/connecting-to-hipchat-xmpp-via-jabber-el ;;
;; for the help. ;;
;; ;;
;; you can look up the necessary jabber info on the account i
@hyOzd
hyOzd / delete-file-and-buffer.el
Created July 21, 2015 11:55
emacs delete current file and close the buffer
;; based on http://emacsredux.com/blog/2013/04/03/delete-file-and-buffer/
(defun delete-file-and-buffer ()
"Kill the current buffer and deletes the file it is visiting."
(interactive)
(let ((filename (buffer-file-name)))
(if filename
(if (y-or-n-p (concat "Do you really want to delete file " filename " ?"))
(progn
(delete-file filename)
(message "Deleted file %s." filename)