Skip to content

Instantly share code, notes, and snippets.

View tjbenton's full-sized avatar

Tyler Benton tjbenton

View GitHub Profile
@tjbenton
tjbenton / ready.html
Last active September 14, 2021 20:27
document.ready Promise
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="./ready.js"></script>
<script>
document.ready.then(function() {
console.log('READY!');
});
</script>
@tjbenton
tjbenton / fly-styles.task.js
Created August 5, 2016 19:54
Fly task to compile styles
export async function styles() {
await this.start([ 'stylesSite', 'stylesPages' ], { parallel: true })
}
export async function stylesWatch() {
await Promise.all([
this.watch('app/styles/**/{site,_*}.scss', 'stylesSite'),
this.watch([ 'app/styles/tools/**/_*.scss', 'app/styles/pages/**/*.scss' ], 'stylesPages'),
])
}
@tjbenton
tjbenton / README.md
Last active June 8, 2016 22:01
Checks for namespacing classes.

Just copy the namespaces.js and past it in the console for the site you're checking and it will log out any namespaces that are used.

@tjbenton
tjbenton / copy.js
Created May 24, 2016 19:26
select text inside of an element and then copy it to the clipboard
function copy(obj) {
try {
if (obj) selectContent(obj)
document.execCommand('copy')
// clears the current selection
window.getSelection().removeAllRanges()
} catch (err) {
console.log(err)
}
}
@tjbenton
tjbenton / git-fork-syncing.md
Last active April 18, 2017 01:25
Sync your fork with the original package

If you know you've already added the upstream repo then skip to step 5

  1. cd to the working directory
  2. List the current configured remote repository for your fork.
git remote -v
# origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
# origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
@tjbenton
tjbenton / virtualbox-vagrant-nuclear-option.sh
Created April 6, 2016 17:28
Completely uninstall VirtualBox and Vagrant and reinstall through brew
# update brew because `brew update` is broken after updating to El Capitan
cd `brew --prefix`
git fetch origin
git reset --hard origin/master
sudo shutdown -r now # restart the computer
# open terminal and run the following
brew update
brew cleanup
@tjbenton
tjbenton / pseudo-elements.md
Created December 17, 2015 18:26 — forked from p3t3r67x0/pseudo_elements.md
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@tjbenton
tjbenton / bower-update.md
Created October 23, 2015 17:44
Update Authored bower package to a new version for bower
# commit your changes
git commit -am "Made some awesome new changes, now its even awesomer"

# tag the commit
git tag -a v0.0.2 -m "Release version 0.0.2"

# push to GitHub
git push origin master --tags  
@tjbenton
tjbenton / SassMeister-input-HTML.html
Created October 14, 2015 13:39
Generated by SassMeister.com.
<div class="o-slider">
<div class="o-slider__slide"></div>
<div class="o-slider__slide"></div>
</div>
@tjbenton
tjbenton / export-syntax.js
Created October 12, 2015 18:59 — forked from caridy/export-syntax.js
ES6 Module Syntax Table
// default exports
export default 42;
export default {};
export default [];
export default foo;
export default function () {}
export default class {}
export default function foo () {}
export default class foo {}