Skip to content

Instantly share code, notes, and snippets.

Des Mayer desmayer

View GitHub Profile
desmayer / manual_time.php
Last active Jul 17, 2017
Clock In Function for Same/Next Day
View manual_time.php
//Part of the system allows an admin to change the clock in/out times if any errors happen
//Once updated it needs to work out the difference between the in and out for other use.
$end = strtotime($details[1]);
$end_mid = strtotime('23:59:59');
//dates & times of in & out - assume the same day for both
$comDTin = date('Y-m-d H:i:s', strtotime("$date $time_in"));
$comDTin_raw = strtotime($comDTin);
$comDTout = date('Y-m-d H:i:s', strtotime("$date $end_raw"));
$comDTout_raw = strtotime($comDTout);
//the out time can NEVER be less than the in time. If it is less that means the user clocked out the following day!
desmayer / hltb.php
Created Nov 21, 2016
PHP to scrap the time data from HLTB
View hltb.php
function hltb($hltbID) {
// Function use || to extract the time data from howlongtobeat based upon the game ID stored in the data base
// 1.Get Data based upon hltbID value
$html = file_get_contents("" . $hltbID);
// howlongtobeat does not name the div that contains the actual time so I will go one div above and then sort through the data
desmayer / comment_system.php
Last active Nov 7, 2016
Basic Comment System with Reply Function
View comment_system.php
<?php session_start();
include 'conn.php';
<script src="jquery.simpletip-1.3.1.js"></script>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
//REPLY START//////////////////////////////////////////////////////
desmayer /
Created Nov 5, 2016
Python - Variables
Do not have to define a variable type. Python will change memory allocation "dynamic typing"
# Initialize a variable with an Interger
var = 8
#Assign a float
var = 3.142
You can’t perform that action at this time.