This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const body = document.getElementsByTagName('body')[0]; | |
const tag = document.createElement('a'); | |
const formId = '#####'; // Change this to your specific form ID | |
tag.setAttribute('class', 'typeform-share button'); | |
tag.setAttribute('href', `https://form.typeform.com/to/${formId}?typeform-medium=embed-snippet`); | |
tag.setAttribute('data-mode', 'popover'); | |
tag.setAttribute('data-open', 'time'); | |
tag.setAttribute('data-open-value', '1000'); | |
tag.setAttribute('target', '_blank'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue'; | |
Vue.directive('secure-input', { | |
inserted(el) { | |
el.type = 'password'; | |
}, | |
bind(el) { | |
el.addEventListener('focus', () => { | |
el.type = 'text' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for x in range(1, 101): | |
if x % 3 == 0 and x % 5 != 0: | |
print "Fizz" | |
elif x % 5 == 0 and x % 3 != 0: | |
print "Buzz" | |
elif x % 5 == 0 and x % 3 == 0: | |
print "FizzBuzz" | |
else: | |
print x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
ParseUserErrors: function(errors) { | |
var validationErrors = []; | |
for (var key in errors) { | |
if (errors.hasOwnProperty(key)) { | |
for (var item in errors[key]) { | |
if (errors[key][item].rule !== "string") { | |
validationErrors.push(errors[key][item].message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// target: The jQuery/Javascript element that you want the function to affect | |
// targetNumber: The max number you want the counter to get to | |
// type: Type of units the function outputs; can be modifed | |
// currentNumber: The number you would like to start from; leave undefined to start from zero | |
function countUp(target, targetNumber, type, currentNumber) { | |
var integer, | |
interval = (3 / targetNumber) * 1000; // 3 is the amount of time to give the counter to reach its desired amount | |
if (currentNumber === undefined) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MIXINS | |
@mixin shadow($color: #B8B8B8) { | |
-webkit-box-shadow: 0 0 10px 2px $color; | |
box-shadow: 0 0 10px 2px $color; | |
} | |
@mixin gradient($color1, $color2) { | |
background: $color1; | |
background: -moz-linear-gradient(top, $color1 0%, $color2 100%); | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,$color1), color-stop(100%,$color2)); |