Skip to content

Instantly share code, notes, and snippets.

View doitian's full-sized avatar
🎯
Focusing

ian doitian

🎯
Focusing
View GitHub Profile
@doitian
doitian / iy-anything.el
Created April 18, 2009 13:35
merge proel into anything
;;{{{ 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
@doitian
doitian / ClockTimer.h
Created May 6, 2009 01:28
ClockTimer.h
/**
* @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>
@doitian
doitian / send_daily_report.sh
Created May 20, 2009 01:15
send daily report
#!/bin/sh
####################
# Configs
#####
VAR_NAME='First Last'
VAR_ADDR='xxx@mail.com'
# cc to me ? yes/no
VAR_CC_ME='yes'
(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:"
// ==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/');
rm -rf /tmp/git_exp
cd /tmp
# create a repository
mkdir -p git_exp/one
cd git_exp/one
git init
touch a
git add a
git commit -m '1st commit in master'
# - Find Tokyo Cabinet installation.
#
# The following are set after the configuration is done:
#
# TokyoCabinet_FOUND - Set to True if Tokyo Cabinet was found.
# TokyoCabinet_INCLUDE_DIRS - Include directories
# TokyoCabinet_LIBRARIES - Libraries required to link
#
# User can change the following variable in cache to indicate where
# Tokyo Cabinet is installed.
#!/bin/bash
# account and host name of the remote server
VAR_HOST=account@host
# session name used in screen
VAR_SESSION_NAME=tunnel
# forwarding port
VAR_PORT=9999
stop () {
;;; The command is extracted from interactively query-replace-regexp:
;;; 1) M-C-% or "M-x query-replace-regexp"
;;; 2) Search: \<[[:upper:]]\{2,\}\>
;;; 3) Replace: \,(capitalize \&)
;;; 4) After finish the query replace, use C-x M-: to extract the command
(defun iy/query-capitalize-upper-word ()
"Capitalize the word with all letters in upcase"
(interactive)
(query-replace-regexp
"\\<[[:upper:]]\\{2,\\}\\>"
#include <iostream>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/thread.hpp>
template <typename T>
struct MFServer
{
void run()