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 | |
// If they selected the first checkbox! | |
if (isset($_POST['checkbox_1']) { | |
echo "You selected: $_POST['checkbox_1']"; | |
} | |
// If they selected the second checkbox! | |
if (isset($_POST['checkbox_1'])) { | |
echo "You selected: $_POST['checkbox_1']"; |
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
/* | |
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/> | |
* | |
* This program is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU General Public License as published by the | |
* Free Software Foundation; either version 2 of the License, or (at your | |
* option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, but WITHOUT | |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
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
/** | |
* Remove the last part of a string. | |
* | |
* This function removes the last part of a string, conditioned on spaces | |
* inbetween the parts. Like words, in a sentence. | |
* | |
* @param String $string The string. | |
**/ | |
function str_remove_lastpart($string) { | |
$string_parts = explode(' ',$string); |
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 | |
/* | |
* Calculate the sunrise/sunset time for Gothenburg, Sweden | |
* | |
* Latitude: 57.696991 | |
* Longitude: 11.986500) | |
*/ | |
$date_sun_info = date_sun_info(strtotime("2019-09-03"), 57.696991, 11.986500); |
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
#!/bin/sh | |
##### | |
# These two shell commands goes through all subfolders in the current standing folder | |
# and deletes vendor & node_module folder. | |
#### | |
# Recursively find and delete all folders called: "node_modules" | |
### Used by npm. | |
find . -name "node_modules" -type d -prune -exec rm -rf '{}' + |
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
#define NOTE_B0 31 | |
#define NOTE_C1 33 | |
#define NOTE_CS1 35 | |
#define NOTE_D1 37 | |
#define NOTE_DS1 39 | |
#define NOTE_E1 41 | |
#define NOTE_F1 44 | |
#define NOTE_FS1 46 | |
#define NOTE_G1 49 | |
#define NOTE_GS1 52 |
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 | |
/** | |
* Find identical content between two arrays. | |
* | |
* | |
* @param Array $first_array | |
* @param Array $second_array | |
* @return Array | |
**/ |
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
<!-- HTML fields --> | |
<input type="time" class="field--time-period-from"> | |
<input type="time" class="field--time-period-to"> | |
<input type="text" class="field--time-difference" disabled> | |
<script> | |
// Get the inputs. | |
let timeField = document.querySelector('.field--time-difference'); | |
let from = document.querySelector('.field--time-period-from').value; | |
let to = document.querySelector('.field--time-period-to').value; |
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
#!/bin/sh | |
# | |
# This file needs to be executed once a new file system is imported. | |
# What this does, is updating project settings to have localhost as root. | |
# | |
# Dev settings & htaccess. | |
if [ -f "src/wp-config.php" ]; then | |
rm src/wp-config.php |
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
#!/bin/sh | |
# | |
# This file needs to be executed once a new database is imported. | |
# What this does, is updating database to tell wordpress that the site should | |
# be runned on localhost. | |
# | |
## Supress warning. | |
export MYSQL_PWD=wordpress |
OlderNewer