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 getShortDateFormat = (function() { | |
var pattern = undefined, | |
defaultPattern = "M/d/yyyy", | |
localeFormatMappings = { | |
"en-us": "M/d/yyyy", | |
"ja-jp": "yyyy\u5E74 M\u6708 d\u65E5" | |
}; | |
return function(date, locale) { | |
var m, d, y; |
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
<div class="ms-MenuUIPopupBody ms-MenuUIPopupScreen" style="position:absolute;"> | |
<div class="ms-MenuUIPopupInner" style="overflow-x: visible; overflow-y: visible; "> | |
<div class="ms-MenuUILarge"> | |
<ul class="ms-MenuUIUL"> | |
<li class="ms-MenuUIULItem"> | |
<div class="ms-MenuUIULItem"> | |
<a class="ms-MenuUIULLink"> | |
<span class="ms-MenuUIIconLarge" style="white-space: nowrap;"> | |
<img class="ms-MenuUIULImg" width="32" height="32" src="/_layouts/images/blank.gif" alt="" title="" /> |
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
// These functions assume that fib(0) = 0, fib(1) = 1 | |
// In other words, 0 and 1 are the seeds of the sequence. | |
function recursiveFib(n) { | |
if(n < 0) { | |
throw "Negative numbers are not allowed."; | |
} | |
if(n < 2) { | |
return n; |
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
#include <iostream> | |
constexpr auto bit(std::size_t index) { | |
return 1ULL << index; | |
} | |
int main() { | |
std::cout << bit(0) << "\n" << bit(1) << "\n" << bit(5) << std::endl; | |
return 0; | |
} |
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 objectA = { a: '1a', b: '1b', c: '1c' }; | |
var objectB = { a: '2a', b: '2b', d: '2d' }; | |
function objectDifference(minuend, subtrahend) { | |
var firstIntersection = _.omit(minuend, _.keys(subtrahend)), | |
secondIntersection = _.omit(subtrahend, _.keys(minuend)); | |
return _.extend(firstIntersection, secondIntersection); | |
} |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
queryParams: { | |
'number': '_number' | |
}, | |
_number: 1, | |
totalPages: 5, | |
number: Ember.computed('_number', { |
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 arr1 = [ | |
['1', '2', '3', '4'], | |
['5', '6', '7', '8'], | |
['9', 'a', 'b', 'c'], | |
['d', 'e', 'f', 'g'], | |
]; | |
function rotCCW(arr) { | |
var n = arr.length; | |
var ret = new Array(n); |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
isFabricsProd: false, | |
actions: { | |
toggleFabricsValue(i, j) { | |
console.log(i, j); | |
console.log('value now: ', this.get('isFabricsProd')); | |
this.toggleProperty('isFabricsProd'); |
OlderNewer