Skip to content

Instantly share code, notes, and snippets.

@rmacqueen
rmacqueen / scroll test
Last active August 29, 2015 14:00
scroll test
const Gtk = imports.gi.Gtk;
let scroll = new Gtk.ScrolledWindow();
let label = new Gtk.Label();
scroll.add(label);
import collections
import Image
import ImageFilter
import util
from resource_prefixes import *
import image_processing.image_tools as ImageTools
class PhotosModel(object):
### Helpers ###
# Returns true if file exists AND file
# is directory
def directory_exists?(directory)
File.directory?(directory)
end
# Returns true if file exists
def file_exists?(filename)
### Helpers ###
# Returns true if file exists AND file
# is directory
def directory_exists?(directory)
File.directory?(directory)
end
# Returns true if file exists
def file_exists?(filename)
const Gtk = imports.gi.Gtk;
const WebKit2 = imports.gi.WebKit2;
Gtk.init(null);
let webview = new WebKit2.WebView();
webview.connect('load-changed', function (event, view) {
print("load-changed called")
});
const Gtk = imports.gi.Gtk;
const WebKit2 = imports.gi.WebKit2;
const Lang = imports.lang;
Gtk.init(null);
// WebKit2.WebContext.get_default().register_uri_scheme('foo', function () {})
const MyWebView = new Lang.Class({
Name: 'MyWebView',
GTypeName: 'MyWebView',
const Gtk = imports.gi.Gtk;
const Pango = imports.gi.Pango;
Gtk.init(null);
let text = " Mon: ကျာ် လ္ဂုၚ်.";
let label = new Gtk.Label({
ellipsize: Pango.EllipsizeMode.END,
lines: 2,
Disco /dev/mmcblk0: 15.8 GB, 15762194432 bytes
32 cabeças, 32 setores/trilhas, 30064 cilindros, total de 30785536 setores
Unidades = setores de 1 * 512 = 512 bytes
Tamanho do setor (lógico/físico): 512 bytes / 512 bytes
Tamanho da E/S (mínimo/ideal): 512 bytes / 512 bytes
Identificador do disco: 0x00000000
Dispositivo Boot Início Fim Blocos Id Sistema
/dev/mmcblk0p1 * 6144 194559 94208 83 Linux
/dev/mmcblk0p2 194560 30785535 15295488 83 Linux