Skip to content

Instantly share code, notes, and snippets.

View samflores's full-sized avatar
🦕

Samuel Flores samflores

🦕
View GitHub Profile
@samflores
samflores / html.vim
Created August 9, 2013 15:18
.vim/after/syntax/html.vim
unlet b:current_syntax
syn include @HTML $VIMRUNTIME/syntax/html.vim
syn include @Handlebars $HOME/.vim/vim-addons/Handlebars/syntax/handlebars.vim
syn region handlebarsTemplate contained
\ start=+<script [^>]*type *=[^>]*text/x-handlebars[^>]*>+
\ end=+</script>+me=s-1 keepend
\ contains=@Handlebars
[#|2014-06-26T15:45:39.197-0300|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=24;_ThreadName=Thread-4;|biz.remanso.polus.controller.exceptions.UnavailableServiceException: biz.remanso.polus.controller.exceptions.UnavailableServiceException: N‹o foi poss’vel encontrar o servio 'loginService[Local, External, Remote]'
at biz.remanso.polus.controller.routing.ServiceInvocator.<init>(ServiceInvocator.java:190)
at biz.remanso.polus.controller.routing.RouterServlet.service(RouterServlet.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:809)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:671)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:505)
at org.apache.catalina.core.ApplicationDispatcher.doDi
This file has been truncated, but you can view the full file.
jun 26, 2014 4:16:41 PM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
-XX:+UnlockDiagnosticVMOptions
-XX:NewRatio=2
-XX:MaxPermSize=192m
-XX:PermSize=64m
-Xmx512m
-javaagent:/usr/local/glassfish3/glassfish/lib/monitor/flashlight-agent.jar
-client
-Djava.security.auth.login.config=/usr/local/glassfish3/glassfish/domains/domain1/config/login.conf
@samflores
samflores / main.rb
Last active August 29, 2015 14:03 — forked from anonymous/main.rb
require 'amazing_redis_queue'
require 'worker'
AmazingRedisQueue.subscribe 'nome_da_fila', MyWorker
AmazingRedisQueue.publish 'nome_da_fila', 'parametro'
# instala o powerline
$ pip install --user git+git://github.com/Lokaltog/powerline
# configura no .tmux.conf
source /Users/samflores/Library/Python/2.7/lib/python/site-packages/powerline/bindings/tmux/powerline.conf
source /Users/samflores/Library/Python/2.7/lib/python/site-packages/powerline/bindings/tmux/powerline_tmux_1.9_plus.conf
# configura o iTerm pra usar uma das fontes do repo https://github.com/Lokaltog/powerline-fonts
$ brew install ant
$ brew install android-sdk
## instale as dependências
$ android
## escolha a SDK Android Platform 4.4.2 (API 19), as System Images que você deseja (ARM, x86, etc). Geralmente não instalo docs ou samples.
$ npm install -g cordova
## instale o PhoneGap
require 'benchmark'
require 'digest'
array = (1..10000).to_a
block = proc { |i| i * 2 }
array.collect &block # esquenta a JVM
Benchmark.bm(7) do |b|
b.report('collect') { array.collect &block }
b.report('map') { array.map &block }
;; 1: normal funtion calls
(attach-events (display-board! (create-board 10)))
;; 1.5: added by popular demand :p
(attach-events
(display-board!
(create-board 10)))
;; 2: "chain"
(-> 10
  • Engatinhando
  • Sintaxe? Que sintaxe?
  • Algumas formas são mais especiais que outras formas
  • Dados são dados, funções são dados, seu código é dado
  • Listas! Listas por toda parte
  • Para entender recursão você precisa primeiro entender recursão
  • Ter preguiça pode ser uma virtude
  • Ponha vários núcleos para trabalhar
  • Abstrair é uma arte
  • Ei, eu sei polimorfismo também
@samflores
samflores / user.rb
Last active August 29, 2015 14:06 — forked from dannluciano/user.rb
class User < ActiveRecord::Base
validates :username, presence: :true
validates :password_digest, presence: :true
has_secure_password
end