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
$(function() { // shorthand for $(document).ready() | |
// get all checkboxes | |
var allCheckboxes = $(".perk:checkbox"); | |
// group them by name for later | |
var groups = {}; | |
allCheckboxes.each(function() { | |
groups[this.name] || (groups[this.name] = []); | |
groups[this.name].push(this); |
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
<?php | |
ob_start(); | |
echo 'Session Cookie: '; | |
if( isset($_COOKIE[session_name()]) ) | |
{ | |
echo 'Present; Content: ' . $_COOKIE[session_name()] . '<br>'; | |
if( session_id() == '') | |
{ | |
echo 'Session not started; starting session<br>'; | |
session_start(); |
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
<?php | |
// Content Type: application/json | |
$time = time(); | |
$secret = '<your-secret-here>'; | |
$headers = getallheaders(); | |
$hubSignature = @$headers['X-Hub-Signature']; |
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
<?php | |
/* | |
########################################################################## | |
# PHP Benchmark Performance Script # | |
# © 2010 Code24 BV # | |
# # | |
# Author : Alessandro Torrisi # | |
# Company : Code24 BV, The Netherlands # | |
# Date : July 31, 2010 # | |
# version : 1.0 # |
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
<?php | |
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($multi_dimensional_array)); | |
$flat_array = iterator_to_array($it, false); // second parameter to preserve keys [default = true] |
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
<?php | |
$a = 5; | |
$b = 2; | |
// status after evaluation | |
// initaial 5,2 | |
$a = $a + $b; // 7,2 | |
$b = $a - $b; // 7,5 | |
$a = $a - $b; // 2,5 |
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
<?php | |
// Database credentials | |
$_servername = "localhost"; | |
$_username = "root"; | |
$_password = ""; | |
$_dbname = "location_db"; | |
// Create connection | |
$_conn = @new mysqli($_servername, $_username, $_password, $_dbname); |
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
-- phpMyAdmin SQL Dump | |
-- version 5.2.1 | |
-- https://www.phpmyadmin.net/ | |
-- | |
-- Host: localhost | |
-- Generation Time: Feb 16, 2023 at 10:12 AM | |
-- Server version: 8.0.29 | |
-- PHP Version: 8.1.6 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |