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
def define_keyword_arguments_method(method_name, *keywords) | |
instance_eval <<RUBY | |
define_method(:#{method_name}){|#{keywords.map{|kw| kw + ':'}.join(', ')}| | |
yield #{keywords.map{|kw| "#{kw}: #{kw}"}.join(', ')} | |
} | |
RUBY | |
end | |
define_keyword_arguments_method(:my_method, 'arg1', 'arg2', 'arg3') do |**kwargs| | |
p kwargs |
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
CommandType Name Version Source | |
----------- ---- ------- ------ | |
Cmdlet Add-Content 3.1.0.0 Microsoft.PowerShell.Management | |
Cmdlet Add-History 3.0.0.0 Microsoft.PowerShell.Core | |
Cmdlet Add-Member 3.1.0.0 Microsoft.PowerShell.Utility | |
Cmdlet Add-Type 3.1.0.0 Microsoft.PowerShell.Utility | |
Cmdlet Clear-Content 3. |
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
#include<X11/Xlib.h> | |
#include<stdio.h> | |
#include<time.h> | |
typedef struct{ | |
int x, y; | |
} Pos; | |
Pos get_pos(Display *dpy, Window root){ | |
Window w; |