This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Org-mode config | |
(setq load-path (cons "~/.emacs.d/org-7.01h/lisp" load-path)) | |
(setq load-path (cons "~/.emacs.d/org-7.01h/contrib/lisp" load-path)) | |
(require 'org-install) | |
(require 'org) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Yasnippet workaround for ruby-electric-mode | |
;; See: http://code.google.com/p/yasnippet/issues/detail?id=71 | |
(defun yas/advise-indent-function (function-symbol) | |
(eval `(defadvice ,function-symbol (around yas/try-expand-first activate) | |
,(format | |
"Try to expand a snippet before point, then call `%s' as usual" | |
function-symbol) | |
(let ((yas/fallback-behavior nil)) | |
(unless (and (interactive-p) | |
(yas/expand)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Code-folding for HAML mode | |
(add-hook 'haml-mode-hook 'hs-minor-mode) | |
(setq hs-special-modes-alist | |
(cons (list | |
'haml-mode "[#.%]" "\n" "/" | |
(lambda (arg) | |
(haml-forward-sexp) | |
(move-beginning-of-line 1)) | |
nil) hs-special-modes-alist)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveSupport::TimeWithZone | |
def to_json(*args) | |
"{\"$date\": #{utc.to_i * 1000}}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Helpful macro function | |
(defun my-macro-query (arg) | |
"Prompt for input using minibuffer during kbd macro execution. | |
With prefix argument, allows you to select what prompt string to use. | |
If the input is non-empty, it is inserted at point." | |
(interactive "P") | |
(let* ((query (lambda () (kbd-macro-query t))) | |
(prompt (if arg (read-from-minibuffer "PROMPT: ") "Input: ")) | |
(input (unwind-protect | |
(progn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(doc, prev) { | |
prev.check_count += 1; | |
prev.total += doc.total; | |
prev.tax += doc.tax; | |
prev.subtotal += doc.subtotal; | |
prev.payment += doc.payment; | |
prev.tender += doc.tender; | |
prev.discount += doc.discount; | |
prev.coupon += doc.coupon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
datetime: Wed Aug 04 13:00:13 UTC 2010, | |
receipts: [ | |
{ ... }, | |
{ ... } | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When /^the MyMedLab order is posted to BioIQ with username "([^\"]*)" and password "([^\"]*)"$/ do |username, password| | |
@response_code = post('api/orders.xml', | |
@mml_order.to_xml(:root => 'order'), | |
{"Content-type" => "text/xml", | |
:authorization => ActionController::HttpAuthentication::Basic. | |
encode_credentials(username, password)}) | |
@parsed_response = Nokogiri::Slop(@response.body) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Result File HTTP Client | |
function resultHTTPClient() { | |
var result_client = Titanium.Network.createHTTPClient(); | |
result_client.open("POST", _hostname + "/endpoint"); | |
var auth = "Basic " + Ext.util.base64.encode(_username + ":" + _password); | |
result_client.setRequestHeader("Authorization", auth); | |
result_client.setRequestHeader("Accept", "application/xml"); | |
result_client.onreadystatechange = function() { | |
if (this.readyState == 4) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dialogCallback(filenames){ | |
alert(filenames[0]); | |
} | |
function selectResultFile() { | |
var options = { | |
multiple: false, | |
title: "Open file", | |
types: ['*'], | |
typesDescription: "All files", |
NewerOlder