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
#!/usr/bin/env python | |
import re | |
import sys | |
patterns = { | |
'[àáảãạăắằẵặẳâầấậẫẩ]': 'a', | |
'[đ]': 'd', | |
'[èéẻẽẹêềếểễệ]': 'e', | |
'[ìíỉĩị]': 'i', | |
'[òóỏõọôồốổỗộơờớởỡợ]': 'o', |
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
// wrapper for our game "classes", "methods" and "objects" | |
window.Game = {}; | |
// wrapper for "class" Rectangle | |
(function(){ | |
function Rectangle(left, top, width, height){ | |
this.left = left || 0; | |
this.top = top || 0; | |
this.width = width || 0; | |
this.height = height || 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
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"my_email_analyzer": { | |
"type": "custom", | |
"tokenizer": "uax_url_email", | |
"filter": ["lowercase", "stop"] | |
} | |
} |
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
"properties": { | |
"content": { | |
"type": "string", | |
+ "search_analyzer": "my_email_analyzer", | |
"fields": { | |
"my_field": { | |
"type": "string", |
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
{ | |
"settings": { | |
"analysis": { | |
"analyzer": { | |
"my_email_analyzer": { | |
"type": "custom", | |
"tokenizer": "uax_url_email", | |
"filter": ["lowercase", "stop"] | |
} | |
} |
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
"properties": { | |
"content": { | |
"type": "string", | |
- "analyzer": "my_email_analyzer" | |
+ "fields": { | |
+ "custom": { | |
+ "type": "string", | |
+ "analyzer": "my_email_analyzer" | |
+ } | |
+ } |
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
describe('The userDisplay component', function() { | |
it('should display the basic user information', function() { | |
var user = { | |
name: 'Bob', | |
job: 'Pianist' | |
}; | |
var element = compileComponent('<user-display user="user"></user-display>', user); | |
expect(element.find('p')[0].html()).to.contain(user.name); | |
expect(element.find('p')[1].html()).to.contain(user.job); |
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
describe('The toggleFollow function', function() { | |
it('should unfollow the followed user', function() { | |
// mock | |
followService.isFollowing = function() { | |
return true; | |
}; | |
var controller = initController(); | |
controller.toggleFollow(); |
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> | |
<p>Name: {{$ctrl.user.name}}</p> | |
<p>Job: {{$ctrl.user.job}}</p> | |
<button ng-click="$ctrl.toggleFollow()"> | |
<span ng-if="{{!$ctrl.isFollowing}}">Follow</span> | |
<span ng-if="{{$ctrl.isFollowing}}">Unfollow</span> | |
</button> | |
</div> |
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
.controller('userDisplayController', function(followService) { | |
var self = this; | |
self.toggleFollow = toggleFollow; | |
self.isFollowing = followService.isFollowing(self.user); | |
function toggleFollow() { | |
if (isFollowing) { | |
followService.unfollow(self.user); | |
self.isFollowing = false; |
NewerOlder