View gist:d0aba144f7e0502fcee8572cfcc6a6f8
### Keybase proof
I hereby claim:
* I am godoy on github.
* I am agodoy (https://keybase.io/agodoy) on keybase.
* I have a public key ASCHj9JiLOg-r_EGv-cMa4ShYioCiFoF3Pd8pcahky6v_go
To claim this, I am signing this object:
View index.html
<script>
(function(t,r,a,c,k) { t[k]=t[k]||function(){ (t[k].q = t[k].q||[]).push(arguments) }
var ts=r.createElement(a);ts.type='text/javascript';ts.async=true;
ts.src=c; var s=r.getElementsByTagName(a)[0];s.parentNode.insertBefore(ts, s); })(window, document,
'script','//rawgit.com/Godoy/776586faf5389d2276aebc179801c0e7/raw/441601291b272a1b5bea191b54e13cce159d7dbf/my_async_plugin.js', 'my_track')
my_track('acessou página');
</script>
<a href="#" onclick="my_track('clicou no link');">Link</a>
View application.rb
module MyAppRails
class Application < Rails::Application
# ...
config.generators.test_framework false
config.generators.javascripts false
config.generators.helper false
config.generators.stylesheets false
end
end
View image_magick_example.rb
def image_generate
# composite compartilhar.png ab.png abc.png
# convert a.png b.png -append ab.png
# composite -font Raleway-Regular.ttf -size 380x200 -gravity east label:Joaquim abc.png abcd.png
file = Tempfile.new(['image1', '.png'])
file.binmode
fileAux = Tempfile.new(['image2', '.png'])
View main.js
// https://github.com/igorescobar/jQuery-Mask-Plugin/tree/master/dist
$(function () {
$('.phone').mask(PhoneMaskBehavior, spOptions);
});
var PhoneMaskBehavior = function (val) {
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
},
spOptions = {
onKeyPress: function (val, e, field, options) {
View my_function-sdk.js
(function () {
// Pop the call queue...
q = window['my_function'].q;
while(a = q.pop()){
my_real_function(a);
}
//copy the complete function under old that was stacking queue
my_function = my_real_function;
})();
View my_function-sdk.js
function my_function(param) {
console.log("in correct function");
console.log(param);
}
View analytics.js
(function(){
window['GoogleAnalyticsObject'] = 'ga';
window['ga'] =
window['ga']
||
function(){
(window['ga'].q = window['ga'].q || [])
.push(arguments)
},
window['ga'].l = 1 * new Date();
View _form.html.erb
<%= form_for(@model, remote: true, html: {role: :form, 'data-model' => 'MODEL_NAME', class: 'send_ajax'}) do |f| %>
<% if @model.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@model.errors.count, "error") %> prohibited this tip from being saved:</h2>
<ul>
<% @model.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
View production.rb
require 'uglifier'
Rails.application.configure do
# ...
# config.assets.js_compressor = :uglifier
config.assets.js_compressor = Uglifier.new(compress: { unused: false })
#...
end