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
| json.professional_histories @histories do |professional_history| | |
| json.id professional_history.id | |
| json.city professional_history.city.name | |
| end |
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
| function! g:UltiSnips_Complete() | |
| call UltiSnips#ExpandSnippet() | |
| if g:ulti_expand_res == 0 | |
| if pumvisible() | |
| return "\<C-n>" | |
| else | |
| call UltiSnips#JumpForwards() | |
| if g:ulti_jump_forwards_res == 0 | |
| return "\<TAB>" | |
| endif |
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
| PRY_CALLS=$(git diff --cached | grep -nw 'binding.pry') | |
| if [ -z "$PRY_CALLS" ]; then | |
| echo "You've left a binding.pry in one or more files:" | |
| echo $PRY_CALLS | |
| exit 1 | |
| fi |
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
| upstream rails_app_server { | |
| # Coloque a porta que o thin vai rodar - nao coloque ele pra rodar na porta 80! | |
| server 127.0.0.1:3000; | |
| } | |
| server { | |
| listen 80; | |
| server_name seudominio; | |
| keepalive_timeout 5; |
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
| NSString *text = [publicacao.texto | |
| stringByTrimmingCharactersInSet:[NSCharacterSet | |
| whitespaceAndNewlineCharacterSet]]; | |
| self.textLabel.text = [text substringToIndex:MIN(text.length, 80)]; | |
| if (text.length > 80) { | |
| self.textLabel.text = [self.textLabel.text stringByAppendingString:@"..."]; | |
| } |
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
| from pyquery import PyQuery | |
| hora_brasilia = PyQuery(url='http://pcdsh01.on.br/HoraLegalBrasileira.asp')("td[bgcolor='#FFFF00']:first").text() | |
| print "Horario de Brasilia", hora_brasilia |
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 MyEnum getEnumObject() { | |
| final List<String> enumStrings = new ArrayList<>(); | |
| enumStrings.add(null); | |
| enumStrings.add("A"); | |
| enumStrings.add("C"); | |
| enumStrings.add("B"); | |
| enumStrings.add("D"); | |
| Optional<MyEnum> e = enumStrings.stream() | |
| .filter(s -> s != null) |
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
| on write_to_file(this_data, target_file, append_data) | |
| try | |
| set the target_file to the target_file as string | |
| set the open_target_file to open for access file target_file with write permission | |
| if append_data is false then set eof of the open_target_file to 0 | |
| write this_data to the open_target_file starting at eof | |
| close access the open_target_file | |
| return true | |
| on error | |
| try |
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 React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import Redux from 'redux'; | |
| import { createStore } from 'redux'; | |
| import { connect, Provider } from 'react-redux'; | |
| class MyComponent extends React.Component { | |
| render() { | |
| const { active, toggle } = this.props; | |
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 store = createStore(); | |
| ReactDOM.mount( | |
| <Provider store={store}> | |
| <WindowWrapper> | |
| <GameCanvas /> | |
| </WindowWrapper> | |
| </Provider> | |
| ) |