Skip to content

Instantly share code, notes, and snippets.

View LukeWJensen's full-sized avatar

Luke Jensen LukeWJensen

  • Salt Lake City, UT
View GitHub Profile
@LukeWJensen
LukeWJensen / nginx_logs_path.sh
Created June 6, 2019 22:52
Nginx error logs path #nginx
/usr/local/var/log/nginx
@LukeWJensen
LukeWJensen / .editorconfig
Created May 10, 2019 18:21
[Boilerplate .editorconfig file] #editorconfig
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
@LukeWJensen
LukeWJensen / eslint_vue.js
Created May 10, 2019 18:19
[ESLint rules for Vue.js projects] #vue #eslint
"extends": [
"plugin:vue/recommended"
],
"rules": {
"indent": "off", //delegate this to editorconfig instead
"vue/html-indent": [
"error",
4
],
"vue/max-attributes-per-line": [
@LukeWJensen
LukeWJensen / matchMedia.js
Created May 10, 2019 18:17
[JS MatchMedia Method] #responsive
var swmq = window.matchMedia( "(min-width: 767px)" );
if (swmq.matches){
//code to apply to query match
}
@LukeWJensen
LukeWJensen / custom_event_on_resize.js
Last active May 10, 2019 18:16
[Custom event on window resize] #event #resize
let resizeTimer;
let resizeCompleteEvent = new CustomEvent('resizeComplete', e => { handleEvent(e.detail) })
let handleEvent = e => console.log(e)
// dispatch custom resize event when a resize event has completed
window.addEventListener('resize', () => {
clearTimeout(resizeTimer)
resizeTimer = setTimeout(() => {
window.dispatchEvent(resizeCompleteEvent)
}, 250)
})
@LukeWJensen
LukeWJensen / responsive_video_wrap.scss
Created May 10, 2019 18:09
[Responsive Video Wrap] #css #scss #video #responsive
.video-wrap {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
iframe, video {
position: absolute;
top: 0;
left: 0;
@LukeWJensen
LukeWJensen / firefox_hack.css
Created May 10, 2019 18:06
[Firefox CSS Hack] #firefox #hack
@-moz-document url-prefix() {
/*css rules here */
}
@LukeWJensen
LukeWJensen / ie10-11_jack.css
Created May 10, 2019 18:05
[CSS Hack for IE10-11] #css #hack #ie11
@media all and (-ms-high-contrast:none) {
/* css rules here */
}
}
@LukeWJensen
LukeWJensen / log_in_mysql.sh
Created May 10, 2019 18:04
[Log In to MySQL] #mysql
mysql -u [user] -p
@LukeWJensen
LukeWJensen / import_mysql.sh
Created May 10, 2019 18:04
[Import MySQL Database] #mysql
mysql -u root -p [db_name] < filename.sql