This file contains hidden or 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
declare module "vue2-datepicker" { | |
import { Component } from "vue/types/options"; | |
/* eslint-disable @typescript-eslint/no-explicit-any */ | |
/* eslint-disable @typescript-eslint/interface-name-prefix */ | |
interface IShortcuts { | |
text: string; | |
start: Date; | |
end: Date; | |
} |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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
## General shorthands. | |
alias update='source ~/.bashrc' | |
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy" | |
alias httpdconf="code /usr/local/etc/httpd/httpd.conf" | |
alias ll='ls -la' | |
alias serve='yarn install && yarn serve' | |
alias eserve='yarn install && yarn electron:serve' | |
alias ylint='yarn lint --fix && yarn lint' | |
alias sshconfig="code ~/.ssh/config" | |
alias bashprofile="code ~/.bash_profile" |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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); |
NewerOlder