Skip to content

Instantly share code, notes, and snippets.

@Avene
Avene / keybase.md
Last active October 30, 2019 06:36

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@Avene
Avene / DefaultKeyBinding.dict
Last active May 17, 2019 06:10
Keybindings for Mac
/* $HOME/Library/KeyBindings/DefaultKeyBinding.dict */
{
/* Remap Home / End keys to be correct */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
@Avene
Avene / Image.xaml
Created April 9, 2017 05:58
binding image uri on xaml
<Image x:Name="Image"
RelativePanel.AlignHorizontalCenterWithPanel="True"
RelativePanel.AlignTopWithPanel="True"
Stretch="Uniform">
<!--http://stackoverflow.com/questions/37311346/windows-10-uwp-binding-image-url-to-image-source-in-listview-->
<Image.Source>
<BitmapImage UriSource="{x:Bind viewModel.ImageUri, Mode=OneWay}" />
</Image.Source>
</Image>
@Avene
Avene / View.xaml
Created April 8, 2017 12:54
Hide element after popout animation on a visualsutate
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="PanelStateGroup">
<VisualState x:Name="StateA">
<Storyboard>
<PopOutThemeAnimation Storyboard.TargetName="ListPanel" />
<PopInThemeAnimation Storyboard.TargetName="SelectionPanel"/>
</Storyboard>
<VisualState.Setters>
<Setter Target="ListPanel.(UIElement.IsHitTestVisible)"
Value="False" />
@Avene
Avene / instance_specific_method
Created December 8, 2014 09:34
add instance-specific method
# オブジェクトにmessageメソッドを追加して返す
def add_message(obj, cause)
(class << obj; self; end).class_eval do
define_method(:message) { " #{cause}" }
end
obj
end
@Avene
Avene / android_Inject_keydown_event_handler_to_WebView_from_native_code
Last active August 29, 2015 14:09
Android WebView にJavascriptのイベントハンドラを追加する ref: http://qiita.com/Avene/items/dee2ee3eca6151e66c3b
@InjectView(R.id.profile_registration_webView)
WebView mWebView;
mWebView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
                 // url to filter target page
if (url.startsWith("http://target/page/url")) {
                //something to do in javascript
view.loadUrl("javascript:$('#target_element_id').keydown( function () {" +
@Avene
Avene / file0.txt
Last active August 29, 2015 14:08
Railsリモートデバッグ(RubyMine+Vagrant) @windows10 Technical Preview ref: http://qiita.com/Avene/items/3f5bedbb48bbd18fc1c4
[vagrant@vagrant project]$ pwd
/vagrant/project
[vagrant@vagrant project]$ ls -ltr
total 18
-rwxrwxrwx 1 vagrant vagrant 478 Nov 1 02:31 README.rdoc
-rwxrwxrwx 1 vagrant vagrant 249 Nov 1 02:31 Rakefile
-rwxrwxrwx 1 vagrant vagrant 154 Nov 1 02:31 config.ru
drwxrwxrwx 1 vagrant vagrant 0 Nov 1 02:31 app
drwxrwxrwx 1 vagrant vagrant 0 Nov 1 02:31 bin