Skip to content

Instantly share code, notes, and snippets.

View desmayer's full-sized avatar

Des Mayer desmayer

View GitHub Profile
@desmayer
desmayer / comment_system.php
Last active March 28, 2023 09:43
Basic Comment System with Reply Function
<?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 / manual_time.php
Last active July 17, 2017 11:10
Clock In Function for Same/Next Day
//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 November 21, 2016 09:39
PHP to scrap the time data from 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("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 / var.py
Created November 5, 2016 22:41
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
print(var)
#Assign a float
var = 3.142
print(var)