Skip to content

Instantly share code, notes, and snippets.

View bratsche's full-sized avatar

Cody Russell bratsche

View GitHub Profile
@bratsche
bratsche / fix-postgres-seqs.rb
Last active September 30, 2015 11:37
Fix up broken id seqs on Postgres after migrating from MySQL using ar_dbcopy gem
require 'pg'
unless ARGV[0]
puts "Pass the name of the database"
exit 1
end
# Get our Postgres connection
conn = PGconn.open(:dbname => ARGV[0], :host => 'localhost')
@bratsche
bratsche / gist:2323633
Created April 6, 2012 22:40
Get implementations
List<T> GetInstances<T>()
{
return (from t in Assembly.GetExecutingAssembly().GetTypes()
where t.GetInterfaces().Contains(typeof (T)) && t.GetConstructor(Type.EmptyTypes) != null
select (T) Activator.CreateInstance(t)).ToList();
}
@bratsche
bratsche / gist:2645575
Created May 9, 2012 15:32
sass mixin for adding arrows to a div
$defaultBorder: none
=arrow($direction, $size, $color, $border: $defaultBorder)
position: relative
border: $border
&:after, &:before
@if $direction == top
bottom: 100%
@else if $direction == right
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;
@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 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)
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)
@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)
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) {
# 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