Skip to content

Instantly share code, notes, and snippets.

@UnderlineWords
UnderlineWords / copy-to-clipboard.js
Created October 1, 2021 20:08
Copy to clipboard with Pure JS
/**
* @referenced https://stackoverflow.com/a/65996386/3299846
* */
function copyToClipboard(e) {
var copyText = document.getElementById(e);
// navigator clipboard api needs a secure context (https)
if (navigator.clipboard && window.isSecureContext) {
// navigator clipboard api method'
return navigator.clipboard.writeText(copyText.value);
} else {
@UnderlineWords
UnderlineWords / function.php
Created July 26, 2021 07:59 — forked from hlashbrooke/function.php
Simple way to generate a random string/password in PHP
<?php
function random_password( $length = 8 ) {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?";
$password = substr( str_shuffle( $chars ), 0, $length );
return $password;
}
?>
@UnderlineWords
UnderlineWords / strong-passwords.php
Created July 26, 2021 07:59 — forked from tylerhall/strong-passwords.php
A user friendly, strong password generator PHP function.
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
@UnderlineWords
UnderlineWords / lxqt-rc.md
Last active May 29, 2021 18:12
Disable window animations for Openbox based window manager on Linux.
  • Open the Terminal.
  • Type: sudo nano ~/.config/openbox/lxqt-rc.xml
  • Look for <animateIconify>yes</animateIconify> then change it to <animateIconify>no</animateIconify>
  • Save the file.
  • Type: openbox --reconfigure
@UnderlineWords
UnderlineWords / autocomplete.html
Last active December 26, 2019 19:23
How to disable autocomplete for password and email / username inputs.
<!--
https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
-->
<input type="email" autocomplete="new-email">
<input type="password" autocomplete="new-password">
@UnderlineWords
UnderlineWords / pagination.blade.php
Last active September 28, 2019 22:56
Custom Laravel Pagination for Bulma - Laravel Documentation https://laravel.com/docs/master/pagination
<?php
/**
* Bulma CSS Framework
* Includes previous and next buttons
* @example $pages->links('pagination', ['paginator' => $pages])
* @example @include('pagination', ['paginator' => $pages])
*
* @link https://bulma.io/documentation/components/pagination/
**/
?>
@UnderlineWords
UnderlineWords / themes.xml
Last active January 16, 2021 07:15
Elite Dangerous - HUD Color Themes
<!--
This collection is including my favorite custom themes.
Copypaste the following snippet into the file GraphicsConfiguration.xml, replacing (only) the similar lines
inside the <GUIColour><Default> tags. Note that this file is overwritten when the game updates,
so you will need to re-apply your theme every time that happens.
-->
<!--
Original Theme
http://arkku.com/elite/hud_editor/
-->
@UnderlineWords
UnderlineWords / install.txt
Last active February 3, 2020 07:30
LAMP Stack Installation
sudo apt update
#
# APACHE2
#
sudo apt install apache2
#
# PHP 7.3
#
@UnderlineWords
UnderlineWords / pagination-advanced.blade.php
Last active January 7, 2020 07:36
Custom Laravel Pagination for Semantic UI - Laravel Documentation https://laravel.com/docs/master/pagination
<?php
/**
* Semantic UI
* Includes previous and next buttons
* @example $pages->links('pagination-advanced', ['paginator' => $pages])
* @example @include('pagination-advanced', ['paginator' => $pages])
*
* @link https://semantic-ui.com/collections/menu.html#inverted Inverted styles
* @see <div class="ui pagination inverted blue menu"> Inverted blue menu
**/
@UnderlineWords
UnderlineWords / horizontal-form.html
Last active March 4, 2018 21:27
Horizontal Form for Semantic UI
<div class="ui form">
<div class="two fields">
<div class="four wide field">
<label>
Input Label
</label>
</div>
<div class="twelve wide field">
<input type="text" value="" placeholder="Input placeholder...">