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
Sete Atitudes para Hackear a Indústria de Software | |
By Klaus Wuestefeld | |
1) Torne-se excelente. | |
Seja realmente bom em alguma coisa. Não fique só choramingando ou | |
querendo progredir às custas dos outros. Não pense q pq vc sentou 4 | |
anos numa faculdade ouvindo um professor falar sobre software q vc | |
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo |
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
module Sass | |
module Rails | |
module Helpers | |
protected | |
def public_path(asset, kind) | |
resolver = options[:custom][:resolver] | |
asset_paths = resolver.context.asset_paths | |
path = resolver.public_path(asset, kind.pluralize) | |
if !asset_paths.send(:has_request?) && ENV['RAILS_RELATIVE_URL_ROOT'] | |
path = ENV['RAILS_RELATIVE_URL_ROOT'] + path |
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
@defer.inlineCallbacks | |
@cyclone.web.asynchronous | |
def put(self): | |
self.set_header('Content-Type', 'application/json') | |
key = str(uuid4()) | |
today = datetime.today().strftime(u'%d/%m/%y %H:%M') | |
user = self._get_current_user()[0] | |
value = self._load_request_as_json().get('value') | |
if not value: | |
log.msg("PUT failed!") |
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
def get(self): | |
key = self._load_request_as_json().get('key') | |
is_metadata_request = self._load_request_as_json().get('metadata') | |
response = self.sam.get(key=key).resource() | |
if hasattr(response.data, 'metadata_key'): | |
if is_metadata_request: | |
response = cyclone.web.escape.json_encode({'metadata_key':response.data.metadata_key}) | |
elif response.data.metadata_key: | |
response = cyclone.web.escape.json_encode({'done':True}) |
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
def calculate | |
bet_scores_per_type = { | |
winner_fighter_id: { @result[:winner_fighter_id] => 10 }, | |
fight_victory_type_id: { @result[:fight_victory_type_id] => 30}, | |
round: { @result[:details][:round] => 50} | |
} | |
user_bets_per_type = { | |
winner_fighter_id: @betting[:bet_fighter_id], | |
fight_victory_type_id: @betting[:fight_victory_type_id] |
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
def start | |
command = "" | |
commands = default_commands | |
add_command(commands, "follow", "following") | |
while command != "q" | |
printf "enter command: " | |
command = gets.chomp | |
process(command, commands) | |
end | |
end |
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
def start | |
command = "" | |
command_processor = CommandProcessor.new | |
command_processor.add_command('follow', 'following') | |
while command != "q" | |
printf "enter command: " | |
command = gets.chomp | |
command_processor.process(command) | |
end | |
end |
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
def start | |
command = "" | |
command_processor = CommandProcessor.new | |
command_processor.add_command('follow', Proc.new { puts 'do some stuff' }) | |
while command != "q" | |
printf "enter command: " | |
command = gets.chomp | |
command_processor.process(command) | |
end | |
end |
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
if not isinstance(processing_result, list): | |
processing_result = [processing_result] | |
for user_attribute in processing_result: | |
if user_attribute is not None: | |
print "INDEXING user_attribute = '%s'" % user_attribute | |
self.es_conn.index("user", module["index_name"], user_attribute, id=attribute_id) |
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
Verifying that +douglascamata is my blockchain ID. https://onename.com/douglascamata |