Skip to content

Instantly share code, notes, and snippets.

@sh4nks
sh4nks / MainWindow.glade
Created March 7, 2012 09:04
Text in einem TextBuffer einfügen
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="MainWindow">
<property name="can_focus">False</property>
<property name="has_resize_grip">False</property>
<signal name="destroy" handler="onWindowDestroy" swapped="no"/>
<child>
<object class="GtkBox" id="vbox">
<property name="width_request">400</property>
@sh4nks
sh4nks / minecraft-installer.py
Created April 18, 2012 09:02
python3 minecraft installer
# License: You can do whatever you want with this script as long as you keep it open source :)
import os
import urllib.request
import shutil
import sys
import subprocess
launcher_folder = os.path.join(os.environ['HOME'], ".local/share/applications")
mc_folder = os.path.join(os.environ['HOME'], ".minecraft")
@sh4nks
sh4nks / gist:3667783
Created September 7, 2012 17:00
ps -u $(whoami) output
PID TTY TIME CMD
2839 ? 00:00:00 gnome-keyring-d
2860 ? 00:00:00 gnome-session
2877 ? 00:00:00 dbus-launch
2878 ? 00:00:04 dbus-daemon
2883 ? 00:00:26 pulseaudio
2888 ? 00:00:00 gconf-helper
2890 ? 00:00:00 gconfd-2
2894 ? 00:00:00 ssh-agent
2896 ? 00:00:00 gvfsd
# Maintainer: Nuno Araujo <nuno.araujo at russo79.com>
pkgname=gnome15
pkgver=0.8.4
pkgrel=5
pkgdesc="Gnome tools for the Logitech G Series Keyboards And Z-10 Speakers"
arch=(any)
url="http://www.gnome15.org"
license=('GPL')
depends=(python2 python-imaging python2-cairo dbus-python pygtk python2-pyinotify
python2-lxml pygobject pyxdg pyusb python2-rsvg python-xlib
diff -ur a/configure.ac b/configure.ac
--- a/configure.ac 2011-09-28 03:37:26.000000000 +0200
+++ b/configure.ac 2012-07-28 01:47:52.089090647 +0200
@@ -115,7 +115,6 @@
progs/demos/Makefile
progs/demos/One/Makefile
progs/demos/shapes/Makefile
- progs/demos/smooth_opengl3/Makefile
progs/demos/spaceball/Makefile
progs/demos/subwin/Makefile
@sh4nks
sh4nks / app.py
Last active December 25, 2015 20:59
integrate flaskbb in another app
from flask import Flask
from werkzeug.serving import run_simple
from werkzeug.wsgi import DispatcherMiddleware
from flaskbb.user.models import User
from flaskbb import create_app as flaskbb
from flaskbb.configs.development import DevelopmentConfig as Config
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy
@sh4nks
sh4nks / lv02.c
Created January 11, 2014 14:54
lv02
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int calc_total(int numbers[], int len) {
int total = 0;
for(int i = 0; i < len; i++) {
total += numbers[i];
}
"""
This test will use the default permissions found in
flaskbb.utils.populate
"""
import pytest
from flaskbb.user.models import User
from flaskbb.forum.models import Forum, Category, Topic, Post
from flaskbb.utils.permissions import *
==> Making package: lxqt-panel-git 0.7.0.45.g125dea7-1 (Sat 5 Jul 08:25:18 CEST 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Updating lxqt-panel git repo...
Fetching origin
==> Validating source files with sha256sums...
lxqt-panel ... Skipped
==> Extracting sources...
-> Creating working copy of lxqt-panel git repo...
import simplejson
import sqlalchemy
from sqlalchemy import String
from sqlalchemy.ext.mutable import Mutable
class JSONEncodedObj(sqlalchemy.types.TypeDecorator):
"""Represents an immutable structure as a json-encoded string."""
impl = String