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
- await CrumbService.read(mockReq, 'CrumbService', { foo: 'foo' }, {}, callback); | |
+ await new Promise(resolve => | |
+ CrumbService.read(mockReq, 'CrumbService', { foo: 'foo' }, {}, (...args) => { | |
+ callback(...args); | |
+ resolve(); | |
+ }) | |
+ ); |
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
// bootstrap-ckeditor-modal-fix.js | |
// hack to fix ckeditor/bootstrap compatiability bug when ckeditor appears in a bootstrap modal dialog | |
// | |
// Include this AFTER both bootstrap and ckeditor are loaded. | |
// From: http://stackoverflow.com/questions/14420300/bootstrap-with-ckeditor-equals-problems | |
// Author: http://stackoverflow.com/users/185839/aaron | |
$.fn.modal.Constructor.prototype.enforceFocus = function() { | |
modal_this = this | |
$(document).on('focusin.modal', function (e) { |
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 isTaiwanId(id) { | |
const mapping = [10, 11, 12, 13, 14, 15, 16, 17, 34, 18, 19, 20, 21, 22, 35, 23, 24, 25, 26, 27, 28, 29, 32, 30, 31, 33]; | |
const ID_REGEX = /^[A-Z][12]\d{8}$/i; | |
if (!ID_REGEX.test(id)) { | |
return false; | |
} | |
return `${mapping[id.toUpperCase().charCodeAt(0)-65]}${id.slice(1)}` | |
.split('') |
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
defmodule Roman do | |
@roman_symbols [ | |
["M", 1000], | |
["CM", 900], | |
["D", 500], | |
["CD", 400], | |
["C", 100], | |
["XC", 90], | |
["L", 50], | |
["XL", 40], |
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
class Foo extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
filterText: '', | |
locations: [] | |
} | |
} | |
updateFilter(e) { |
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
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
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
$.get( "your_partial.html", function( data ) { | |
$( "#your_div" ).html( data ); | |
alert( "Load was performed." ); | |
}); |
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
watch('.*\.jade') {|md| system("jade -P -O .. #{md[0]}")} | |
watch('.*\.styl') {|md| system("stylus -o ../css #{md[0]}")} | |
watch('.*\.coffee') {|md| system("coffee -bc -o ../js #{md[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
"content_scripts": [ | |
{ | |
"matches": ["http://www.xxx.com/*"], | |
"css": ["css/bootstrap.css", "css/content.css"], | |
"js": ["js/jquery.min.js", "js/content.js"] | |
} | |
] |
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
<link rel="stylesheet/less" type="text/css" href="styles.less"> | |
<script src="less.js" type="text/javascript"></script> |
NewerOlder