Skip to content

Instantly share code, notes, and snippets.

View RobbieTheWagner's full-sized avatar
🚢
🐙

Robbie Wagner RobbieTheWagner

🚢
🐙
View GitHub Profile
@gitKrystan
gitKrystan / README.md
Last active November 7, 2023 18:43
ember-cli-mirage types

Skylight ember-cli-mirage Types

These types were written by the team at https://www.skylight.io/, specifically @gitKrystan (with lots of help from @chancancode).

Gist filenames don't allow slashes, so I replaced them with :.

Before you start

Add "<app-name>/mirage/*": ["mirage/*"] to your paths config in your tsconfig.json

@ef4
ef4 / select.hbs
Last active October 7, 2021 09:41
Goodbye old Select View
<select onchange={{action (mut vehicle) value="target.value"}}>
{{#each vehicles key="@item" as |vehicleChoice|}}
<option value={{vehicleChoice}} selected={{eq vehicle vehicleChoice}}>{{vehicleChoice}}</option>
{{/each}}
</select>
@linhmtran168
linhmtran168 / pre-commit-eslint
Last active June 20, 2024 23:01
Pre-commit hook to check for Javascript using ESLint
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$")
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@dlukez
dlukez / ngTagsInput-restrictToMaxTags.js
Last active November 7, 2019 16:53
A directive that extends mbenford/ngTagsInput to hide the tags input when the max tags limit is been reached.
/**
* A directive to hide the tags input when the max tags limit is reached.
* Works with github.com/mbenford/ngTagsInput
*/
angular.module('dz.restrictToMaxTags', ['ngTagsInput']).directive( 'restrictToMaxTags', function () {
var KEY_BACKSPACE = 8
KEY_TAB = 9;
return {
require: 'ngModel',
@joshbeckman
joshbeckman / animatedScrollTo.js
Created September 30, 2013 14:51
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;