Skip to content

Instantly share code, notes, and snippets.

View mattdangerw's full-sized avatar
🐶

Matt Watson mattdangerw

🐶
  • Google
  • San Francisco
View GitHub Profile
@mattdangerw
mattdangerw / gist:8817721
Created February 5, 2014 05:10
em in gtk, and em with sdk
const Gtk = imports.gi.Gtk;
const Gdk = imports.gi.Gdk;
const System = imports.system;
let css = "\n\
GtkLabel {\n\
font-size: 5em;\n\
}\n";
Gtk.init(null, 0);
@mattdangerw
mattdangerw / gist:9085326
Created February 19, 2014 03:04
commit hook
#!/bin/bash
# move this script to the .git/hooks directory for your repo. or to a global
# git template directory. make sure to chmod +x this file
branch=`git rev-parse --abbrev-ref HEAD`
for repo in "sdk" "shell"; do
if [[ $branch == $repo/* ]]; then
number=`echo $branch | awk -F/ '{print $2}'`
@mattdangerw
mattdangerw / gist:9404925
Created March 7, 2014 03:47
Video playback crash
const Gtk = imports.gi.Gtk;
const Gdk = imports.gi.Gdk;
const System = imports.system;
const WebKit2 = imports.gi.WebKit2;
let html = '\n\
<!doctype html>\n\
<html>\n\
<body>\n\
<div id="player">\n\
const Lang = imports.lang;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const TestObject = new Lang.Class({
Name: 'TestObject',
Extends: GObject.Object,
Properties: {
'prop': GObject.ParamSpec.string('prop', '', '', GObject.ParamFlags.WRITABLE, '')
},
From bfb1b394c54072ad003064c6d8bc65b27366647c Mon Sep 17 00:00:00 2001
From: Matt Watson <mattdangerw@gmail.com>
Date: Sun, 11 Oct 2015 12:20:48 -0400
Subject: [PATCH] gtkwidget: add css margin support
---
gtk/gtkwidget.c | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
#!/bin/bash -ex
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/small-screen/ name 'Small Screen'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/small-screen/ command 'xrandr -s 720x480'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/small-screen/ binding '<Super>comma'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/large-screen/ name 'Large Screen'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/large-screen/ command 'xrandr -s 1920x1080'
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/pl
From 61ce96242b70a24bb6d58b3f6fd576b0009af9bb Mon Sep 17 00:00:00 2001
From: Matt Watson <mattdangerw@gmail.com>
Date: Thu, 10 Dec 2015 15:50:25 -0800
Subject: [PATCH] gtkstack: remove needless queue_resize
In gtk_stack_set_transition_position we should only need to
queue_resize if we are non-homogeneous, which is already done
earlier in the function.
---
gtk/gtkstack.c | 2 --
@mattdangerw
mattdangerw / gist:6457235
Created September 5, 2013 22:43
clutter draggable actor
const Clutter = imports.gi.Clutter;
// Convenience function to parse a clutter color from a string
function parse_clutter_color(color_string) {
let [res, color] = Clutter.Color.from_string(color_string);
return color;
}
Clutter.init(null, null);
From 8f28c163346b4ca388320bd25f6d44ac767fa55d Mon Sep 17 00:00:00 2001
From: Matt Watson <mattdangerw@gmail.com>
Date: Fri, 8 Jan 2016 16:06:53 -0800
Subject: [PATCH] resource file: add cancel to dummy monitor
gfilemonitor has a cancel vfunc and will call into the in dispose.
If we don't stub it out we get a segfault.
---
gio/gresourcefile.c | 7 +++++++
1 file changed, 7 insertions(+)
From 9d5477d77febb7f6dbf1487270a5165922e35617 Mon Sep 17 00:00:00 2001
From: Matt Watson <mattdangerw@gmail.com>
Date: Fri, 8 Jan 2016 16:06:53 -0800
Subject: [PATCH] resource file: add cancel to dummy monitor
gfilemonitor has a cancel vfunc and will call into the in dispose.
If we don't stub it out we get a segfault.
---
gio/gresourcefile.c | 7 +++++++
1 file changed, 7 insertions(+)