This file contains hidden or 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
Rails | |
.application | |
.routes | |
.named_routes | |
.sort_by(&:to_s) | |
.collect do |_, route| | |
[ | |
route.name, | |
[ | |
route.path.spec.to_s, |
This file contains hidden or 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 Optionable | |
extend ActiveSupport::Concern | |
included do | |
def self.options(action, allowed) | |
send :define_method, "#{action}_options" do | |
puts "Allow: #{allowed}" | |
end | |
end | |
end |
This file contains hidden or 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
javascript:(match=window.location.toString().match(/(?:embed\/|(\?|\&)v=|\/v\/)(\w+)/i))&&(window.location="http://www.youtube-nocookie.com/embed/"+match.pop());void 0; |
This file contains hidden or 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
<div class="block"> | |
Teste | |
</div> | |
<div class="block_alert"> | |
teste 2 | |
</div> | |
<div class="block_alert__dashed"> | |
Teste |
This file contains hidden or 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
# rails | |
# pre-defined method in string | |
class String | |
def digits | |
self.gsub /\D/, '' | |
end | |
end | |
# in my controller | |
find_params = params |
This file contains hidden or 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
var cb, republish; | |
republish = function(message, update, queue, callback) { | |
if (typeof update === "function") { | |
callback = update; | |
queue = update || queue; | |
update = void 0; | |
} | |
if (typeof queue === "function") { | |
callback = callback || queue; |
This file contains hidden or 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
"use strict"; | |
var status, status_type; | |
status = { | |
OFFLINE: 0, | |
ONLINE: 1 | |
}; | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze |
This file contains hidden or 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
<?php session_start(); ?> | |
<form action="/manda-email.php"> | |
<textarea name="texto">Gostaria de fazer um orçamento para os seguintes produtos: | |
<?php | |
if (isset($_SESSION['produtos'])) { | |
echo implode("\n", $_SESSION['produtos']); | |
} | |
?></textarea></form> |
This file contains hidden or 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
/*jslint node: true*/ | |
var grunt = require('grunt'), | |
gruntFile = require('./Gruntfile.js'), | |
task, | |
tasks; | |
gruntFile(grunt); | |
task = process.argv.length > 2 ? process.argv[2] : ''; |
This file contains hidden or 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
#!/bin/bash | |
node -e 'grunt=require("grunt");require("./Gruntfile")(grunt);console.log(Object.keys(grunt.config.data).join(" "))' |