This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import choice | |
import toga | |
from toga.style import Pack | |
from toga.constants import ROW, COLUMN | |
bee_movies = [ | |
{'year': 2008, 'title': 'The Secret Life of Bees', 'rating': '7.3', 'genre': 'Drama'}, | |
{'year': 2007, 'title': 'Bee Movie', 'rating': '6.1', 'genre': 'Animation, Adventure, Comedy'}, | |
{'year': 1998, 'title': 'Bees', 'rating': '6.3', 'genre': 'Horror'}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
filename=$1 | |
basefilename=$(basename ${filename}) | |
tmpdir=$(mktemp -d -t) | |
cp ${filename} ${tmpdir}/ | |
cd ${tmpdir} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
from selenium.common.exceptions import NoSuchElementException | |
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile | |
from time import sleep | |
from sys import argv | |
find_likes = lambda browser: browser.find_elements_by_css_selector('.post_control.like.liked') | |
def find_next_page(browser): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Only let level 1 members sign up if they use a discount code. | |
Place this code in your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmpro_registration_checks_require_code_to_register($pmpro_continue_registration) | |
{ | |
//only bother if things are okay so far | |
if(!$pmpro_continue_registration) | |
return $pmpro_continue_registration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Redirect away from the checkout page if you don't have a required level. | |
*/ | |
function my_template_redirect_upgrade() | |
{ | |
global $pmpro_pages, $pmpro_level; | |
if(empty($pmpro_pages)) | |
return; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read in CSV file that's formatted as a Crosstab (empty top left cell, top row contains column names and first column contains row names) | |
# `header = T` pulls column names from first row | |
# `row.names = 1` pulls row names from first column, so starts from 1, not 0 | |
b2009 <- read.csv("20092009 Beer - CrossTab.csv", header = T, row.names = 1) | |
table <- as.table(as.matrix(b2009)) | |
test <- data.frame(table) | |
# Add names to Columns, starting from leftmost column | |
colnames(test) <- c("Beer","Judge","Rating") |
NewerOlder