Skip to content

Instantly share code, notes, and snippets.

from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.chrome.options import Options

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@metulburr
metulburr / irc.md
Created January 29, 2018 15:38 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
@metulburr
metulburr / games.json
Created September 12, 2017 19:38
get games list
{
"BANG!": {
"link": "https://boardgamegeek.com/boardgame/3955/bang",
"user_rating": "8",
"geek_rating": "6.429"
},
"BANG! The Dice Game": {
"link": "https://boardgamegeek.com/boardgame/143741/bang-dice-game",
"user_rating": "6",
"geek_rating": "6.880"
------------------
System Information
------------------
Time of this report: 6/27/2016, 04:19:05
Machine name: WINDOWS8
Operating System: Windows 10 Home 64-bit (10.0, Build 10586) (10586.th2_release_sec.160527-1834)
Language: English (Regional Setting: English)
System Manufacturer: ASUSTeK COMPUTER INC.
System Model: M11BB
BIOS: 0307
import pygame as pg
import random
screen = pg.display.set_mode((800,600))
screen_rect = screen.get_rect()
clock = pg.time.Clock()
done = False
class Ball:
@metulburr
metulburr / gist:a0da897fe38ae631b6cb
Created March 20, 2016 19:19
darken image pygame
dark = pygame.Surface((image.get_width(), image.get_height()), flags=pygame.SRCALPHA)
dark.fill((50, 50, 50, 0))
image.blit(dark, (0, 0), special_flags=pygame.BLEND_RGBA_SUB)
#will subtract 50 from the RGB values of the surface called image.
@metulburr
metulburr / gist:9cc96ea9f2e1b9c4cee9
Created March 10, 2016 22:57
color surface functions
#no other libs requires other than pygame
def colorize(image, newColor):
"""
Create a "colorized" copy of a surface (replaces RGB values with the given color, preserving the per-pixel alphas of
original).
:param image: Surface to create a colorized copy of
:param newColor: RGB color to use (original alpha values are preserved)
:return: New colorized Surface instance
"""
image = image.copy()
import pygame
screen = pygame.display.set_mode((800,600))
clock = pygame.time.Clock()
photo = pygame.image.load('test.jpg').convert_alpha()
photo2 = pygame.image.load('test2.jpg').convert_alpha()
album = [photo, photo2]
index = 0
timer = 0.0
done = False