- Dynamic Dispatch
- Dynamic Method
- Ghost Methods
- Dynamic Proxies
- Blank Slate
- Kernel Method
- Flattening the Scope (aka Nested Lexical Scopes)
- Context Probe
- Class Eval (not really a 'spell' more just a demonstration of its usage)
- Class Macros
This file contains hidden or 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
| /** | |
| * Author: Jason White | |
| * | |
| * Description: | |
| * Reads joystick/gamepad events and displays them. | |
| * | |
| * Compile: | |
| * gcc joystick.c -o joystick | |
| * | |
| * Run: |
This file contains hidden or 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
| // Example of how to use boost::asio::async_result | |
| #include <iostream> | |
| #include <boost/asio.hpp> | |
| #if BOOST_VERSION >= 106600 | |
| template<typename CompletionToken> | |
| typename boost::asio::async_result | |
| <CompletionToken, void(boost::system::error_code, std::string)>::return_type |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # cb-aerosnap: | |
| # A script for adding aero style window snapping to Openbox. | |
| # Written for CrunchBang Linux <http://crunchbang.org/> | |
| # by Philip Newborough <corenominal@corenominal.org> | |
| # ---------------------------------------------------------------------- | |
| # License: | |
| # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| # Version 2, December 2004 | |
| # |
This file contains hidden or 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 | |
| # | |
| # i3blocks integration with dunst. | |
| # Author: Vivien Didelot <vivien.didelot@gmail.com> | |
| # | |
| # dunst caches a notification and signals i3blocks. | |
| # i3blocks catches the signal and prints the cached notification. | |
| # | |
| # Put this rule at the end of your ~/.config/dunst/dunstrc: | |
| # |
- 원제 : 55 Trivia Notations you should know in Ruby
- 원문 : kyoendo
- 출처 : http://melborne.github.io/2013/03/04/ruby-trivias-you-should-know-4/
- 번역 : nacyot propellerheaven@gmail.com
- 라이센스 : cc-by-nc
Ruby는 즐거운 언어입니다. Ruby를 사용하다보면 매뉴얼에도 나와있지 않은 '작은 발견'을 만나게 됩니다. 이러한 '발견'은 프로그램의 질이나
Hi:
perl -e 'print "hello world!\n"'
A simple filter:
perl -ne 'print if /REGEX/'
Filter out blank lines (in place):
Portions taken from http://www.cs.utexas.edu/~mitra/csSpring2011/cs327/cx_mac.html (in case that link ever dies.)
Assume you've got homebrew installed.
Download the following files from Oracle
This file contains hidden or 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
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains hidden or 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
| #include "StdAfx.h" | |
| #include <Setupapi.h> | |
| #pragma comment(lib, "Setupapi.lib") | |
| #include "SerialPort.h" | |
| SerialPort::SerialPort(void) : end_of_line_char_('\n') | |
| { | |
| } |