Skip to content

Instantly share code, notes, and snippets.

View serdarsen's full-sized avatar

Serdar ŞEN serdarsen

View GitHub Profile
@Furao
Furao / combo.py
Created September 1, 2011 21:35
Prevent a Combobox from scrolling in PyGTK
def combo_scrolling(combobox, event):
"""Prevent the comboboxes from scrolling."""
combobox.emit_stop_by_name("scroll-event")
values = ['item 1', 'item 2', 'item 3']
combo = gtk.combo_box_new_text()
# Fill with part type options
for val in values:
@zsimic
zsimic / DefaultKeyBinding.dict
Last active July 17, 2024 17:40
OSX key bindings
{
/* ~/Library/KeyBindings/DefaultKeyBinding.dict
See https://gist.github.com/zsimic/1367779, prefix cheatsheet:
Char Short Key
$ S- Shift ⇧
^ C- CTRL ⌃
~ O- Option ⌥ (⊞ Win key position on PC)
@ M- Command ⌘ (Alt position on PC)
# Numeric Keypad
@lithid
lithid / Grid
Created February 20, 2013 02:05
Here is a grid using python and GTK3, loading dynamically based on window size/re-size. I came up with this example while trying to mimic a gridview of images for a wallpaper application. The example is below.
#!/usr/bin/env python2
from gi.repository import Gtk
class Grid(Gtk.Window):
widget_list = []
WIDGET_SIZE = 140
COLS = 1
NUM = 100
def calcule_columns(self, scroll, grid):
@fcwu
fcwu / hello.py
Created June 17, 2013 03:34
python, gtk 3 and CSS
#!/usr/bin/python3
from gi.repository import Gtk, Gdk
import sys
class MyWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Hello World")
self.set_name('MyWindow')
@isimmons
isimmons / gist:8202227
Last active July 26, 2024 16:15
Truncate tables with foreign key constraints in a Laravel seed file.

For the scenario, imagine posts has a foreign key user_id referencing users.id

public function up()
{
	Schema::create('posts', function(Blueprint $table) {
		$table->increments('id');
		$table->string('title');
		$table->text('body');
@jampola
jampola / clock.py
Last active June 25, 2024 15:33
Simple clock using PyGTK and GObject.timeout_add()
#!/usr/bin/python
from gi.repository import Gtk, GObject
from datetime import datetime
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="app")
self.box = Gtk.Box(spacing=6)
self.add(self.box)
@lopspower
lopspower / README.md
Last active January 20, 2024 09:18
Publish AAR to jCenter and Maven Central

Publish AAR to jCenter and Maven Central

Twitter

EDIT: You can find this same updated tutorial here -> Medium

Now I'm going to list how to publish an Android libray to jCenter and then syncronize it with Maven Central:

  1. I use "Android Studio" and I have this simple android lib that I would like to be available on maven: CircularImageView
@AnderRasoVazquez
AnderRasoVazquez / redbluebuttons.py
Last active March 18, 2021 21:06
[Python Gtk red and blue button] How to use gtk styles to color buttons in GTK #GTK #Python
# blue button
button_equal = Gtk.Button()
button_equal.get_style_context().add_class(Gtk.STYLE_CLASS_SUGGESTED_ACTION)
# red button
button_clear = Gtk.Button()
button_clear.get_style_context().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION)
@3v1n0
3v1n0 / glib-menu-model-window-introspection.py
Last active June 20, 2018 16:31
Parse GTK Menu Model
#!/usr/bin/python
from __future__ import print_function
import re
import signal
import subprocess
import sys
from gi.repository import Gio, Gtk, GLib