Skip to content

Instantly share code, notes, and snippets.

<pre style="font: 10px/5px monospace;">+++++++++++++''++'''''''''++'''''''''''''''''''''''''''''''++++'''''''''';;;'''';'+''''';;;;;;;;;:::,,......`.```:';,.:;''''''''':::::,:;:::;;::::::::;;;;';;;;;;;;;;;;;;;;;:.`::.``````````````````````
+++++++++++++''++'''''''''++'''''''''''''''''''''''''''''''+++++''''''''''';'''';''';'''';;;;;;;;:::,,........```:;;,.:;'''''''''::,::,:::::;;:::::::::;;;'';;;;;;;;;;;;;;;;:.`::.``````````````````````
++++++++++++++'++'''''''''''''''''''''''''''''''''''''''''++++++''''''''''''''''''+''''''''';;;;;:::,,.........``:;;;:;;'''''''';:::::::;:::::::::::::::;;;'';;;;;;;;;;;;;;;:,`,;.``````````````````````
+++++++'+++++++++'''''''''''''''''''''''''''''''''''''''''''+++'''''''''''''''''''''''''''''';;;;;::,,,........``:;'''';;;;;''''';;;;;:;';;;;:::::::::::;;;;;;;;;;;;;;;;;;;;:,.,:,``````````````````````
++++++++++++++++'''''''''''''''''''''''''''''''''''''''''''++++'''''''''''''''''''';;''''''';;;;;:::,,,........``:;;';;::::;;''''';;';''''''';;;;;;;;;;;;;;;;''''''';;;;;;;;;:..:,```

Este es un Bot homenaje a la quizás más grande personalidad de los últimos tiempos que vio la Argentina.

¿Quién lo hizo?

Alejandro, su tuiter es @esacrosa

¿Cómo se hizo?

Bajé todos los tuits de Ricardo y los analicé para que el Bot pueda crear frases que estén basadas exclusivamente en variaciones de lo que él mismo tuiteó.

@acrosa
acrosa / gist:20d42074b064836d3cbb79e42038351b
Last active June 2, 2017 18:11
JavaScript (Node) no tiene multi-threading, y desperdicia el hardware que podrías usar.
Las opciones sugeridas para utilizar todo el hardware disponible son:
1. Modulo “cluster”.
2. Usar Web Workers o algun otro modo de comunicacion entre procesos para dividir el trabajo.
3. Usar N procesos en vez de threads.
Ninguna de estas opciones sirve.
Suponiendo que tu hardware tiene N cores, veamos las opciones en detalle:
protocol ClassProtocol
{
var property: SomePropertyProtocol? { get set }
}
protocol SomePropertyProtocol
{
}
class SomeClass : ClassProtocol
[info]
[info] == update ==
[info] :: retrieving :: net.databinder#twine_2.8.1 [sync]
[info] confs: [compile, runtime, test, provided, system, optional, sources, javadoc]
[info] 0 artifacts copied, 14 already retrieved (0kB/47ms)
[info] == update ==
[success] Successful.
[info]
[info] Total time: 2 s, completed Mar 6, 2011 7:07:53 PM
> run
$ curl 'http://localhost:8082/earlyflush/crazy' -i
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Content-Type: text/html;charset=utf-8
Transfer-Encoding: chunked
Date: Fri, 28 Jan 2011 21:25:15 GMT
Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes.
The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them.
$ curl 'http://localhost:8083/earlyflush/crazy' -i
HTTP/1.1 200 OK
Date: Fri, 28 Jan 2011 21:23:07 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Server: Jetty(6.1.22)
Here’s to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes.
The ones who see things differently. They’re not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them.
About the only thing you can’t do is ignore them. Because they change things. They invent. They imagine. They heal. They explore. They create. They inspire. They push the human race forward.
@acrosa
acrosa / rack_patch.rb
Created January 25, 2011 00:47
required for doing early flush on JRuby under Tomcat
class JRuby::Rack::Response
def write_body(response)
stream = response.getOutputStream
begin
@body.each do |el|
stream.write(el.to_java_bytes)
stream.flush
end
rescue LocalJumpError => e
# HACK: deal with objects that don't comply with Rack specification
@acrosa
acrosa / earlyflushing.rb
Created January 25, 2011 00:40
early flush
require 'rubygems'
require 'sinatra'
require 'sinatra/reloader'
require 'lib/rack_patch'
# this get's executed for all actions
before do
content_type :html, 'charset' => 'utf-8'
end
@acrosa
acrosa / oauth-monkey-patch.rb
Created December 13, 2010 12:20
OAuth gem workaround on JRuby
module OAuth::Signature::HMAC
class Base < OAuth::Signature::Base
private
def digest
self.class.digest_class Object.module_eval("::Digest::#{self.class.digest_klass}")
digest = OpenSSL::Digest::Digest.new('sha1')
OpenSSL::HMAC.digest(digest, secret, signature_base_string)
end
end
end