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
group :production do | |
gem 'thin' | |
gem 'pg' | |
end | |
group :development, :test do | |
gem 'sqlite3' | |
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
News.find_each(&:save) |
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
<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> |
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 MyAppRails | |
class Application < Rails::Application | |
# ... | |
config.generators.test_framework false | |
config.generators.javascripts false | |
config.generators.helper false | |
config.generators.stylesheets false | |
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 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']) |
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
// 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) { |
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
(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; | |
})(); |
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
function my_function(param) { | |
console.log("in correct function"); | |
console.log(param); | |
} |
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
(function(){ | |
window['GoogleAnalyticsObject'] = 'ga'; | |
window['ga'] = | |
window['ga'] | |
|| | |
function(){ | |
(window['ga'].q = window['ga'].q || []) | |
.push(arguments) | |
}, | |
window['ga'].l = 1 * new Date(); |
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
<%= 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> |