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
// Referenced from http://ccoenraets.github.io/es6-tutorial-data/promisify/ | |
let request = obj => { | |
return new Promise((resolve, reject) => { | |
let xhr = new XMLHttpRequest(); | |
xhr.open(obj.method || "GET", obj.url); | |
if (obj.headers) { | |
Object.keys(obj.headers).forEach(key => { | |
xhr.setRequestHeader(key, obj.headers[key]); | |
}); |
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
Found here: https://coderwall.com/p/euwpig/a-better-git-log | |
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit | |
I guess that's a bit too long, eh? Let's just make an alias. Copy and paste the line below on your terminal: | |
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
And every time you need to see your log, just type in | |
git lg |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
//Parent component | |
export default Vue.extend({ | |
props:{ | |
propValue:{ | |
required:false, | |
default:false, | |
type: Boolean | |
} | |
}, | |
provide: function(){ |
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
<template lang="pug"> | |
li(@click='$store.commit("UPDATE_SIDE_NAV_ACTIVE_ITEM", $el)') | |
slot | |
</template> | |
<script> | |
export default { | |
data () { | |
return { | |
provideData: { |
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
// inputEl is the search <input> element, | |
//predictiveItemsEl is the container element for the predictive search list, | |
//predictiveItemsListEl is the <ul> list itself. | |
//I use this inside an object created from the search element. | |
function submitPredictivetext(inputEl, predictiveItemsEl, predictiveItemsListEl) { | |
var $this = jQuery(inputEl), | |
thisValue = $this[0].value, | |
thatValue=""; | |
var timer = $this.data('timeout') || 500, |
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
(function() { | |
var docEl = document.querySelectorAll('html'); | |
docEl[0].setAttribute('data-useragent', navigator.userAgent); | |
/* IE10 and up no longer use the conditional IE hack - they are supposed to render very closely to what you find in WebkitGecko | |
But not really. So you still have to write conditional styles. | |
This is a small script that throws the browser's user-agent string on the <html> element. You can then write styles for thatt particular browser rendering. | |
For IE 10, 11, you use part of the string in your css to target the style declaration. NOTE: IE11's string is actually 'Trident/7.0' |