I hereby claim:
- I am jasonhwest on github.
- I am jasonhwest (https://keybase.io/jasonhwest) on keybase.
- I have a public key ASBLX3RG_cOipMY-IzGj9kWPcM_zpyt2yuUerP3xWaz58Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| // https://hackernoon.com/measuring-web-performance-its-really-quite-simple-adeda8f7f39e | |
| function logTimes(message) { | |
| performance.mark(message); // this one is for WebPageTest | |
| console.timeStamp(message); // this is for the Performance tab in Chrome DevTools | |
| console.info(message, performance.now()); // this is for the console, duh | |
| // this here is for Google Analytics | |
| ga('send', { | |
| hitType: 'timing', |
git init to create a new git repository.git clone /path/to/repository when using a remote server, your command will be git clone username@host:/path/to/repositorygit add <filename> git add * This is the first step in the basic git workflow. To actually commit these changes use git commit -m "Commit message" Now the file is committed to the HEAD, but not in your remote repository yet.| // Use @include colorize('image.png', red, 0.5) | |
| @mixin colorize($image, $color, $opacity) { | |
| background: $color; | |
| $color: transparentize($color, 1 - $opacity); | |
| background: -webkit-linear-gradient(left, $color, $color), url($image); | |
| background: -moz-linear-gradient(left, $color, $color), url($image); | |
| background: -ms-linear-gradient(left, $color, $color), url($image); | |
| background: -o-linear-gradient(left, $color, $color), url($image); | |
| } |
This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.
Here are the required steps to create a command:
Create a new Gist with a command.js and command.json file, or simply fork this one.
Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.
Add some metadata to the command.json file:
| //original from http://www.erichynds.com/javascript/a-recursive-settimeout-pattern/ | |
| var poller = { | |
| // number of failed requests | |
| failed: 0, | |
| // number of failed requests allowed | |
| failedLimit: 10, | |
| // starting interval - 5 seconds |
| html, body, .container, .content { | |
| height: 100%; | |
| } | |
| .container, .content { | |
| position: relative; | |
| } | |
| .proper-content { | |
| padding-top: 40px; /* >= navbar height */ |
| var currentTime = new Date(); | |
| var hours = currentTime.getHours(); | |
| var minutes = currentTime.getMinutes(); | |
| var suffix = "AM"; | |
| if (hours >= 12) { | |
| suffix = "PM"; | |
| hours = hours - 12; | |
| } | |
| if (hours == 0) { |