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 Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| }); |
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 Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| myService: Ember.inject.service(), | |
| appName: 'Ember Twiddle', | |
| showNewNav: Ember.computed('myService.showNewNavItems', function() { | |
| return this.get('myService').showNewNavItems; | |
| }), | |
| actions: { | |
| btnHandler: function () { |
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
| public static boolean balance(String str) { | |
| HashMap<String, String> delimMap = new HashMap<String, String>(); | |
| delimMap.put("{", "}"); | |
| delimMap.put("(", ")"); | |
| Stack<Character> delimStack = new Stack<Character>(); | |
| for (int i = 0; i < str.length(); i++) { | |
| if (delimMap.containsKey(String.valueOf(str.charAt(i)))) { | |
| delimStack.push(str.charAt(i)); | |
| } else { |
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
| shopt -s extglob | |
| rm -rf !(var_opt|var_log) |
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
| # search for multiple words in output | |
| sed -n '/nameserver/p;/domain/p;/search/p' /etc/resolv.conf | |
| # strip last char | |
| < > | sed '$s/.$//' | |
| # math operation | |
| result=`expr $a + $b` | |
| # get length |