Skip to content

Instantly share code, notes, and snippets.

View bratsche's full-sized avatar

Cody Russell bratsche

View GitHub Profile
@bratsche
bratsche / unmuck.sh
Created October 12, 2015 19:14
Autoconf cleanup for El Capitan
#!/bin/sh
while true
do
if [ -d confdir-14B---/confdir-14B--- ]
then
mv confdir-14B---/confdir-14B--- a
fi
if [[ $? -ne 0 ]]
@bratsche
bratsche / gist:ee81699a6960fb3b1233
Last active August 29, 2015 14:23
Seq.findIndex
F# Interactive for F# 3.1 (Open Source Edition)
Freely distributed under the Apache 2.0 Open Source License
For help type #help;;
> let scale1 = seq { -0.5 .. 0.1 .. 0.5 } ;;
val scale1 : seq<float>
> scale1 |> Seq.toArray ;;
void HandleSearchEntryActivated (object sender, EventArgs e)
{
var pattern = SearchPopupSearchPattern.ParsePattern (ToolbarView.SearchText);
if (pattern.Pattern == null && pattern.LineNumber > 0) {
DestroyPopup ();
var doc = IdeApp.Workbench.ActiveDocument;
if (doc != null && doc.Editor != null) {
doc.Select ();
doc.Editor.Caret.Location = new Mono.TextEditor.DocumentLocation (pattern.LineNumber, pattern.Column > 0 ? pattern.Column : 1);
doc.Editor.CenterToCaret ();
# In production mode
2.1.0 :001 > p = { a: 1, b: 2, c: 3 }
=> {:a=>1, :b=>2, :c=>3}
2.1.0 :002 > params = ActionController::Parameters.new(p)
=> {"a"=>1, "b"=>2, "c"=>3}
2.1.0 :003 > params.permit(:a)
=> {"a"=>1}
2.1.0 :004 >
# In development mode
public TreePath[] GetSelectedRows ()
{
IntPtr list_ptr = gtk_tree_selection_get_selected_rows (Handle, IntPtr.Zero);
if (list_ptr == IntPtr.Zero)
return new TreePath [0];
GLib.List list = new GLib.List (list_ptr, typeof (Gtk.TreePath));
TreePath[] paths = (TreePath[]) GLib.Marshaller.ListToArray (list, typeof (Gtk.TreePath));
foreach (TreePath path in paths) {
@bratsche
bratsche / gist:6811122
Created October 3, 2013 14:52
Chrome Canary
Process: Google Chrome Canary [6057]
Path: /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary
Identifier: com.google.Chrome.canary
Version: 32.0.1659.0 (1659.0)
Code Type: X86 (Native)
Parent Process: launchd [231]
User ID: 501
Date/Time: 2013-10-03 09:47:04.764 -0500
OS Version: Mac OS X 10.8.5 (12F37)
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 1cde4fc..a9ffc09 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2029,6 +2029,114 @@ ensure_stacking_on_activate_app (MSG *msg,
}
}
+static gboolean
+wm_char_wparam_needs_translation (WPARAM wParam)
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 1cde4fc..065b350 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -2029,6 +2029,110 @@ ensure_stacking_on_activate_app (MSG *msg,
}
}
+static gboolean
+wm_char_wparam_needs_translation (WPARAM wParam)
@bratsche
bratsche / gist:6186287
Created August 8, 2013 16:37
gtk.immodules
"/Users/cody/xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/lib/gtk-2.0/2.10.0/immodules/im-am-et.so"
"am_et" "Amharic (EZ+)" "gtk20" "/Users/cody/xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/share/locale" "am"
"/Users/cody/xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/lib/gtk-2.0/2.10.0/immodules/im-cedilla.so"
"cedilla" "Cedilla" "gtk20" "/Users/cody/xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa"
"/Users/cody/xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/lib/gtk-2.0/2.10.0/immodules/im-cocoa.so"
"cocoa" "Mac OS X Cocoa" "gtk+" "" "ja:ko:zh"
"/Users/cody/xamarin/bockbuild/profiles/monodevelop-mac-dev/build-root/_install/lib/gtk-2.0/2.10.0/immodules/im-cyrillic-translit.so"
diff --git main/src/addins/MacPlatform/MacPlatform.cs main/src/addins/MacPlatform/MacPlatform.cs
index a55635f..b3f3b79 100644
--- main/src/addins/MacPlatform/MacPlatform.cs
+++ main/src/addins/MacPlatform/MacPlatform.cs
@@ -285,14 +285,22 @@ namespace MonoDevelop.MacIntegration
ApplicationEvents.Reopen += delegate (object sender, ApplicationEventArgs e) {
if (IdeApp.Workbench != null && IdeApp.Workbench.RootWindow != null) {
IdeApp.Workbench.RootWindow.Deiconify ();
+ IdeApp.Workbench.RootWindow.Visible = true;