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 debounce(callback, wait, immediate = false) { | |
let timeout = null | |
return function() { | |
const callNow = immediate && !timeout | |
const next = () => callback.apply(this, arguments) | |
clearTimeout(timeout) | |
timeout = setTimeout(next, wait) |
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
var myApp = angular.module('myApp', []); | |
myApp.directive('googleplace', function() { | |
return { | |
require: 'ngModel', | |
link: function(scope, element, attrs, model) { | |
var options = { | |
types: [], | |
componentRestrictions: {} | |
}; |
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
cd ~/.ssh | |
ssh-keygen -t rsa | |
cat id_rsa.pub | |
copy key | |
go to BitBucket -> Accounts -> Security -> SSH -> Add key -> Paste key | |
go to server -> Before we begin, navigate to your repository on the Bitbucket website and copy its SSH URL. This will be in the format git@bitbucket.org:<username>/<repo-name>.git | |
example: git clone --mirror git@bitbucket.org:<username>/<repo-name>.git | |
Notice the --mirror flag? As its name implies this flag creates an exact mirror of the source repository, including mapping it’s remote branches. It implies --bare, which means that our repository will not have a working copy. |
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 a = Object.freeze({ | |
foo: { greeting: 'Hello' }, | |
bar: 'world', | |
baz: '!' | |
}); | |
a.foo.greeting = 'Goodbye'; | |
console.log(`${ a.foo.greeting }, ${ a.bar }${a.baz}`); |
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
// With shared state, the order in which function calls are made | |
// changes the result of the function calls. | |
const x = { | |
val: 2 | |
}; | |
const x1 = () => x.val += 1; | |
const x2 = () => x.val *= 2; |
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
// Facebook SDK | |
angular.module('facebook', []) | |
.directive('fb', ['$FB', function($FB) { | |
return { | |
restrict: "E", | |
replace: true, | |
template: "<div id='fb-root'></div>", | |
compile: function(tElem, tAttrs) { | |
return { | |
post: function(scope, iElem, iAttrs, controller) { |
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
//**************************************************************************************************** [ FLEXBOX ] | |
=flexbox | |
display: -webkit-box | |
display: -moz-box | |
display: -ms-flexbox | |
display: -webkit-flex | |
display: flex | |
// align flex items along the main axis of the current line of the flex container: flex-start | flex-end | center | space-between | space-around |
NewerOlder