Skip to content

Instantly share code, notes, and snippets.

View dwm-noborders-20191126-cb3f58a.diff
From 54b3ebd727272af097e7dfb935b724f871fdde01 Mon Sep 17 00:00:00 2001
From: Sebastian Jarsve <sebastianjarsve@gmail.com>
Date: Tue, 26 Nov 2019 09:11:22 +0100
Subject: [PATCH] Remove borders from specific clients
Remove borders from clents when in monocle layout and in tile layout
when there is only one client.
---
dwm.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
@SebastianJarsve
SebastianJarsve / dwm-nomonocleborders-20190607-cb3f58a.diff
Created Jun 7, 2019
dwm patch which disables borders on non-floating clients in the monocle layout
View dwm-nomonocleborders-20190607-cb3f58a.diff
From ebf49ca1785c9ed259d04d26d30a16e09554f382 Mon Sep 17 00:00:00 2001
From: Sebastian Jarsve <sebastianjarsve@gmail.com>
Date: Fri, 7 Jun 2019 08:08:13 +0200
Subject: [PATCH] remove borders from nonfloating clients in monocle layout
---
dwm.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dwm.c b/dwm.c
View TicTacToe.py
# coding: utf-8
import ui, console
class Grid (object):
def __init__(self):
self.cells = [0 for i in range(9)]
self.current_player = 1
def add_brick(self, pos):
@SebastianJarsve
SebastianJarsve / indentation.py
Created Aug 13, 2014
To use with Pythonista
View indentation.py
import editor, console
script = editor.get_text()
selection = editor.get_selection()
selected_text = script[selection[0]:selection[1]].splitlines()
indentation = int(console.input_alert('Indent'))
replacement = []
for line in selected_text:
if indentation > 0:
View MazeCreator.py
from scene import *
from random import choice
def opposite(d):
return (d[0]*-1, d[1]*-1)
def sub_tuples(a, b):
return (a[0]-b[0], a[1]-b[1])
def add_tuples(a, b):
View GameOfLife.py
# -*- coding: utf-8 -*-
# Conway's game of life.
# Touch cells to give them life.
# Tap screen with two fingers to pause/un-pause.
# Tap screen with three fingers to give life to random cells.
from scene import *
from PIL import Image, ImageDraw
import random
View Impossiball_Clone.py
from scene import *
from random import randint
screen_size = Size()
class Ball (object):
def __init__(self, pos=None, size=Size(70, 70), c=(1,0,0)):
load_image('White_Circle')
if pos is None:
pos = Point(randint(0, screen_size.w), randint(0, screen_size.h))
View Calculator.py
from __future__ import division
from scene import *
from math import sqrt, pi
import sound
button_pad = [['ans', 'pi', 'sqrt(', '%'],
['(', ')', '*', '/'],
['7', '8', '9', '-'],
['4', '5', '6', '+'],
['1', '2', '3', '='],
View Breakout_Clone.py
# -*- coding: utf-8 -*-
# Created by Sebastian Jarsve
# 9. April 2013
from scene import *
from sound import play_effect
from random import randint
def centered_rect(x, y, w, h):
return Rect(x-w/2, y-h/2, w, h)
View xkcd_reader.py
from scene import *
from sound import play_effect
from PIL import Image
import urllib, cStringIO
class StartPhoto(object):
def __init__(self):
self.title = 'Python'
self.link = 'http://imgs.xkcd.com/comics/python.png'
self.file = Image.open(cStringIO.StringIO(urllib.urlopen(self.link).read())).convert('RGBA')