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
require 'mongoid/relations/metadata' | |
class Mongoid::Relations::Metadata | |
def determine_inverse_foreign_key | |
if has_key?(:inverse_of) | |
if inverse_class_name? && inverse_of | |
inverse_class_name.constantize.relations[inverse_of.to_s].foreign_key | |
else | |
inverse_of ? "#{inverse_of.to_s.singularize}#{relation.foreign_key_suffix}" : nil | |
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
on escapeHtml(theText) | |
do shell script "ruby -rcgi -e 'ARGV.each {|a| puts CGI.escape_html(%Q<#{a}>)}' -- " & quoted form of theText | |
end escapeHtml | |
set theLines to {} | |
tell application "OmniFocus" | |
-- If no document is open, open one | |
tell default document | |
if number of document window is 0 then |
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
# ~/.tmuxinator/docker.yml | |
name: docker | |
root: ~/testbed/docker | |
windows: | |
- shell: | | |
unset DYLD_LIBRARY_PATH; \ | |
unset LD_LIBRARY_PATH; \ | |
tmux set-environment -u DYLD_LIBRARY_PATH; \ |
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
<?php | |
header('Content-Type: text/calendar; charset=utf-8'); | |
$url = 'https://tower.im/calendars/ical/' . htmlspecialchars($_GET['id']) . '.ics'; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | |
$output = curl_exec($ch); | |
$lastkey = NULL; | |
$event = NULL; |
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
<?php | |
header('Content-Type: text/calendar; charset=utf-8'); | |
$url = 'https://tower.im/calendars/ical/' . htmlspecialchars($_GET['id']) . '.ics'; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | |
$output = curl_exec($ch); | |
$lastkey = NULL; | |
$event = NULL; |
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
;;{{{ Anything | |
(require 'anything-config) | |
(setq anything-input-idle-delay 0.2) | |
(setq anything-idle-delay 0.7) | |
(setq anything-quick-update t) | |
(setq anything-c-locate-db-file (expand-file-name "~/.localdb")) | |
(setq anything-c-locate-options `("locate" "-d" ,anything-c-locate-db-file "-i" "-r")) | |
(setq anything-candidate-separator |
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
/** | |
* @file utility/ClockTimer.h | |
* | |
* Created <2009-03-02 16:37:39 Ian Yang> | |
* Last Updated <2009-03-02 16:37:45 Ian Yang> | |
*/ | |
#ifndef UTILITY_CLOCK_TIMER_H | |
#define UTILITY_CLOCK_TIMER_H | |
#include <boost/date_time/posix_time/posix_time.hpp> |
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
#!/bin/sh | |
#################### | |
# Configs | |
##### | |
VAR_NAME='First Last' | |
VAR_ADDR='xxx@mail.com' | |
# cc to me ? yes/no | |
VAR_CC_ME='yes' |
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
(defvar iy/calendar-copy-date-format-history '("%Y-%m-%d")) | |
(defun iy/calendar-copy-date (arg) | |
"Copy date under the cursor. Read format from minibuffer if ARG, | |
use recently used format if no ARG. See the function `format-time-string' | |
for the document of time format string" | |
(interactive "P") | |
(let ((date (calendar-cursor-to-date t)) | |
(format (if arg | |
(completing-read | |
"Date Format:" |
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
// ==UserScript== | |
// @name Mirrorrr It | |
// @namespace mirrorrr.appspot.com | |
// @include http://*.blogspot.com/* | |
// @include https://*.blogspot.com/* | |
// @exclude http://mirrorrr.appspot.com/* | |
// @exclude https://mirrorrr.appspot.com/* | |
// ==/UserScript== | |
location.href = location.href.replace(/^https?:\/\//, 'https://mirrorrr.appspot.com/'); |
OlderNewer