Skip to content

Instantly share code, notes, and snippets.

Des Mayer desmayer

View GitHub Profile
@desmayer
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
desmayer / hltb.php
Created Nov 21, 2016
PHP to scrap the time data from HLTB
View hltb.php
<?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("http://howlongtobeat.com/game.php?id=" . $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
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//////////////////////////////////////////////////////
$(document).ready(function(){
@desmayer
desmayer / var.py
Created Nov 5, 2016
Python - Variables
View var.py
"""
Do not have to define a variable type. Python will change memory allocation "dynamic typing"
"""
# Initialize a variable with an Interger
var = 8
print(var)
#Assign a float
var = 3.142
print(var)
You can’t perform that action at this time.