Simple select all.
SELECT * FROM users;
User.all
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash |
# Resque job to do the true outbound sending | |
class DeliverEmailJob | |
include ProjectName::Job::Logging | |
@queue = :mail_queue | |
def self.perform(args) | |
message = QueuedEmail.get!(args["message_id"]) | |
logger.info("Delivering (%s) to %s" % [message.subject, message.formatted_recipient]) |
%% @doc A binary tree implementation in Erlang. | |
%% A binary tree stores keys and values. | |
-module(binary_tree). | |
-export([init/0, init/1, insert/3, lookup/2]). | |
-define(EMPTY_NODE, {node, 'empty'}). | |
%% @doc Initialize an empty binary tree node. | |
%% This is how the root of the tree should be established. | |
%% |
/* | |
Assuming you have an enum type like this. | |
You want to rename 'pending' to 'lodged' | |
*/ | |
CREATE TYPE dispute_status AS ENUM('pending', 'resolved', 'open', 'cancelled'); | |
BEGIN; | |
ALTER TYPE dispute_status ADD VALUE 'lodged'; | |
UPDATE dispute SET status = 'lodged' WHERE status = 'pending'; |
/** | |
* Get RSpec-style let() in your Mocha/Jasmine specs. | |
*/ | |
var let = function (callback) { | |
var value, called = false; | |
var memoizer = function() { | |
if (called) { | |
return value; | |
} else { | |
called = true; |
(defschedule app-schedule "Application tasks" | |
[:every "5 seconds" (println "Woohoo!")] | |
[:at "7am tomorrow" (wake-up!)]) |
(defmacro demo-> [val & fns] | |
(reduce (fn [acc fname] (list fname acc)) val fns)) | |
(macroexpand '(demo-> 42 inc dec inc)) ; (inc (dec (inc 42))) |
;; vim-style increment/decrement numbers | |
(defun inc-number-at-point (n) | |
"Increment the number under the point, if present. | |
Called with a prefix argument, changes the number by N." | |
(interactive "p") | |
(let ((amt (or n 1)) | |
(word (thing-at-point 'word)) | |
(bounds (bounds-of-thing-at-point 'word))) | |
(when (string-match "^[0-9]+$" word) | |
(replace-string word |
(defun colorize-mode-line (&rest args) | |
(let ((color (cond ((evil-insert-state-p) "#fa4444") | |
((evil-emacs-state-p) "#fafa00") | |
((buffer-modified-p) "#22bff0")))) | |
(set-face-background 'mode-line (or color "#ffffff")))) | |
(add-to-list 'post-command-hook 'colorize-mode-line) |