This file contains hidden or 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 { Injectable, EventEmitter } from '@angular/core'; | |
| @Injectable() | |
| export class TypeingListen extends EventEmitter<boolean> { | |
| private keyStack:string[] = []; | |
| private emptyInterval:any; | |
| constructor( private password:String ) { |
This file contains hidden or 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 watcher = new StyleChangeWatcher(); | |
| watcher.watch(element, ["width"]); | |
| watcher.observer.subscribe((event:StyleChangeEvent) => { | |
| console.log('Element:', event.element); | |
| console.log('Change:', event.change.property,':', event.change.previous, '=>', event.change.current); | |
| }); | |
This file contains hidden or 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
| # Angular 1.5 | |
| class Button { | |
| constructor( $http ) { | |
| this.http = $http; | |
| } | |
| } | |
| angular.module('x').component('xbutton', { | |
| ..., | |
| controller: Button | |
| }); |
This file contains hidden or 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 flatten = arr => arr.reduce( | |
| (a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), [] | |
| ); |
This file contains hidden or 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
| package main | |
| /** | |
| * @website http://albulescu.ro | |
| * @author Cosmin Albulescu <[email protected]> | |
| */ | |
| import ( | |
| "bytes" | |
| "fmt" |
This file contains hidden or 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
| /* | |
| There are sets of node ids which contain partly-contiguous ranges of node ids. | |
| The rst part of the exercise is to (in a language of your choice) model the | |
| ranges in a space ef cient manner. | |
| An example set: | |
| a/1, a/2, a/3, a/4, a/128, a/129, b/65, b/66, c/1, c/10, c/42 | |
| Secondly, given the model already developed, write an algorithm that | |
| will add two sets, merging any overlapping ranges. |
This file contains hidden or 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 | |
| <div ng-class="ChatController"> | |
| <chat> | |
| <div chat-messages class="messages"> | |
| <div chat-message class="message-item"> | |
| </div> | |
| </div> | |
| <div class="footer"> |
This file contains hidden or 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
| echo "cookbook_path [\"/opt/aws/opsworks/current/site-cookbooks\"]" > solo.rb && opsworks-agent-cli get_json > attributes.json && sudo /opt/aws/opsworks/current/bin/chef-solo -c ./solo.rb -j ./attributes.json -o |
This file contains hidden or 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
| /* | |
| $scope.autoScrollEnabled = true; | |
| $scope.onSendMessage = function() { | |
| // enable autoscrolling in case is disabled by user scroll up | |
| $scope.$emit('$enableAutoScroll'); | |
| }; |
This file contains hidden or 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
| <?php | |
| use Phalcon\Mvc\Micro, | |
| Phalcon\Events\Manager as EventsManager, | |
| Phalcon\Http\Response, | |
| Phalcon\Http\Request; | |
| //Create a events manager | |
| $eventManager = new EventsManager(); |