Skip to content

Instantly share code, notes, and snippets.

View zag2me's full-sized avatar

Zag zag2me

  • UK
View GitHub Profile
# Python 2.7
import sqlite3
from sqlite3 import Error
# Function to write a line to the log file
def write_to_log(message):
with open('log.txt', 'a') as the_file:
the_file.write(message.encode('utf-8') + '\n')
@zag2me
zag2me / functions.php
Created March 12, 2018 10:05
Get current shortened soccer season
function currentSeason() {
// The current shortened football season
if (date('n') > 8) {
// Check if its past August for new season
$year1 = substr(date("Y",strtotime("+1 year")),2,4);
$year2 = substr(date("Y"),2,4);
} else {
// Check if its before August for current season
$year1 = substr(date("Y"),2,4);
$year2 = substr(date("Y",strtotime("-1 year")),2,4);
@zag2me
zag2me / php
Created November 13, 2015 13:34
<!DOCTYPE html>
<html>
<head>
<title>Ebay Finder</title>
</head>
<body>
<p>Enter the Ebay URL</p>
<?php