Skip to content

Instantly share code, notes, and snippets.

View lxmmxl56's full-sized avatar
🏠
Working from home

Matt lxmmxl56

🏠
Working from home
View GitHub Profile
@lxmmxl56
lxmmxl56 / bs4ContentWrapper.html
Last active November 10, 2019 00:02
Paste-able Bootstrap 4 Styles Wrapper
<!--
This as a way to implement Bootstrap 4 styles into a page that you can only paste code into and may have some built-in
styles that might overwrite what you're trying to do. All of the styles are specified into a `-content-wrapper` and
the basic layout classes are renamed so it shouldn't affect any menu, footer, or other global content on the platform
you're using.
# How to use
Do a global search for `-content-wrapper` and then add any specific string to the beginning to make your wrapper
unique, e.g. `tv001-content-wrapper`.
@lxmmxl56
lxmmxl56 / respTabsAcc.html
Created July 22, 2019 03:32
Bootstrap 4 Responsive Tabs to Accordion - To add more tabs/content, copy the two copy from here to here sections and change the two and Two (case sensitive) variable names to your desired names.
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style>
.nav-tabs-resp-acc {
display: none;
}
@media(min-width:768px) {
@lxmmxl56
lxmmxl56 / respFontSize.css
Created July 22, 2019 03:31
Responsive Font Size w/o Breakpoints - This can be used for fully responsive font size based on a minimum and maximum font size along with a minimum and maximum width. Uses a calc with vw units to set the size.
.class {
font-size: calc(14px + (24 - 14) * (100vw - 400px)/(1600 - 400));
}
font: min max min width: min max min
@lxmmxl56
lxmmxl56 / httpHeaders.conf
Created July 22, 2019 03:30
HTTP Headers Here are some basic HTTP headers you can use to secure a site in the Apache vhost conf file. You can add {'unsafe-inline' 'unsafe-eval'} and {*.yoursite.com} to each section of the Content-Security-Policy if necessary. Check your site's security compliance at the following link:https://securityheaders.com/?q=[www.yoursite.com]&follo…
Header always set Content-Security-Policy: "default-src 'self'; script-src 'self'; img-src 'self' data:; connect-src 'self'; style-src 'self'; font-src 'self'; frame-src 'self'"
Header set Cache-Control "private; max-age=31536000"
Header set Pragma "no-cache"
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set Referrer-Policy "no-referrer-when-downgrade"
@lxmmxl56
lxmmxl56 / sslSecurity.conf
Created July 22, 2019 03:28
SSL Security - Use the following SSL security headers in your Apache vhost conf file to secure a site. Test your site's SSL headers at the following link: https://www.ssllabs.com/ssltest/analyze.html?d=[www.mysite.com]&latest
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3 -TLSv1
SSLHonorCipherOrder on
SSLCipherSuite ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES256-SHA:AES128-SHA256:AES128-SHA:DES-CBC3-SHA:!ADH:!aNULL:!MD5:!RC4:!DES:!EDH:!IDEA:!3DES
@lxmmxl56
lxmmxl56 / macRandPass.sh
Last active November 9, 2019 23:54
Mac Terminal Random Password Generator - Generates a random 32 character string (upper case, lower case, and numbers) and copies it to the clipboard.
LC_ALL=C tr -dc A-Za-z0-9 < /dev/urandom | fold -w ${1:-32} | head -n 1 | pbcopy
@lxmmxl56
lxmmxl56 / bs4ContentWrapper.html
Last active July 22, 2019 03:26
Paste-able Bootstrap 4 Styles Wrapper - How to use: Do a global search for -content-wrapper and then add any specific string to the beginning to make your wrapper unique, e.g. tv001-content-wrapper. Renames: Bootstrap's `container`, `row`, and `col` classes have been changed to: `tnoc` `wor` & `loc`
<style>
#-content-wrapper {--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace} #-content-wrapper *,::after,::before{box-sizing:border-box} #-content-wrapper {font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent} #-content-wra
@lxmmxl56
lxmmxl56 / JapaneseCharacter.java
Created May 26, 2016 04:18 — forked from mediavrog/JapaneseCharacter.java
Simple string conversion from Hiragana to Katakana and vice versa. Uses the JapaneseCharacter class from Duane J. May and combines it with a simple Utility class method to perform the actual conversion.
/**
* JapaneseCharacter contains static functions to do various tests
* on characters to determine if it is one of the various types of
* characters used in the japanese writing system.
* <p/>
* There are also a functions to translate between Katakana, Hiragana,
* and Romaji.
*
* @author Duane J. May <djmay@mayhoo.com>
* @version $Id: JapaneseCharacter.java,v 1.2 2002/04/20 18:10:24 djmay Exp $