Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Exodus111
Exodus111 / gist:4484734
Created January 8, 2013 15:37
Pygame gist for dirty sprites.
chimp = Chimp()
fist = Fist()
allsprites = pygame.sprite.LayeredDirty((chimp, fist))
allsprites.clear(screen, background)
# mainloop
rects = allsprites.draw(screen)
pygame.display.update(rects)
@Exodus111
Exodus111 / gist:5423533
Created April 19, 2013 22:02
New bolt class
class Bolt(pygame.sprite.DirtySprite):
def __init__(self, player):
self.player = player
self.image = pygame.image.load("bolt.png").convert_alpha()
self.rect = self.image.get_rect()
self.pos = vec2d(player.rect.center)
self.dirty = 1
self.lvl = 1
self.dmg = int((player.lvl * 0.5) + (self.lvl * 0.5) + 25)
self.speed = 25 + self.lvl
#!/usr/bin/env python2
"""
This is a program to sort downloaded series files into individual folders.
This program does in no way condone illegal file downloading.
Downloading files illegally is immoral and WRONG, and can be punished by up to life in prison or the death penalty (depending on your state or country).
Illegal downloads steals the hard earned money of not only starving artists but most importantly hard working executive producers, who desire nothing but the well being of their audience, but thanks to illegal downloading, can barely survive in todays economy living only by sleeping on their friends couches and hitchhiking to work.
Use this program at your own discretion, I am in no way responsible for what you do with it, or how you chose to live your life, but call your mom dude... seriously.
"""
Folderizer 2
"""
import re
from path import path
root = path("./Test")
def find_pattern(names):
pattern = "S\d+E\d"
"""
Folderizer.
This is a program to sort downloaded series files into individual folders.
This program does in no way condone illegal file downloading.
Downloading files illegally is immoral and WRONG, and can be punished by up to life in prison or the death penalty (depending on your state or country).
Illegal downloads steals the hard earned money of not only starving artists but most importantly hard working executive producers, who desire nothing but the well being of their audience, but thanks to illegal downloading, can barely survive in todays economy living only by sleeping on their friends couches and hitchhiking to work.
Use this program at your own discretion, I am in no way responsible for what you do with it, or how you chose to live your life, but call your mom dude... seriously.
def move_2(self):
if self.arrows[0]: #Up
self.movement(self.dir.y, -self.speed, "Up")
if self.arrows[1]: #Left
self.movement(self.dir.x, -self.speed, "Left")
if self.arrows[2]: #Down
self.movement(self.dir.y, self.speed, "Down")
if self.arrows[3]: #Right
self.movement(self.dir.x, self.speed, "Right")
#!/bin/bash
# Kill Conky If Running . If you want to run this conky along with other
# Put a "#" Symbol before the "test" word from below line .
test -z "`pgrep conky`" || killall -9 conky
# The directory of conkyrcs
#conky_dir="./conkyrc"
# The command for start conkys
##
# — SETTINGS — #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
double_buffer yes
no_buffers yes
text_buffer_size 1024
imlib_cache_size 0
#!/bin/bash
uri=$1 #URI of RSS Feed
lines=$2 #Number of headlines
titlenum=$3 #Number of extra titles
#Script start
#Require a uri, as a minimum
if [[ "$uri" == "" ]]; then
echo "No URI specified, cannot continue!" >&2
#!/bin/bash
while [[ 1 -eq 1 ]]; do
for i in $(echo /usr/share/backgrounds/*.jpg); do
echo $i
gsettings set org.gnome.desktop.background picture-uri file:///${i}
sleep 60;
done
done