Skip to content

Instantly share code, notes, and snippets.

View dayvsonlima's full-sized avatar

Dayvson Lima dayvsonlima

View GitHub Profile
pt-BR:
simple_form:
"yes": 'Sim'
"no": 'Não'
required:
text: 'obrigatório'
mark: '*'
# You can uncomment the line below if you need to overwrite the whole required html.
# When using html, text and mark won't be used.
# html: '<abbr title="required">*</abbr>'
var HashHack = {
PREFIX: '#hhMessage=',
postMessage: function(el, sMessage) {
if ('string' === typeof el) {
el = document.getElementById(el);
}
var sUrl = el.src.replace(/#.*/, '');
el.src = sUrl + HashHack.PREFIX + encodeURIComponent(sMessage);
var HashHack = {
PREFIX: '#hhMessage=',
aCallbacks: [],
sLastHash: '',
handleInterval: function() {
var sHash = window.location.hash,
sDecodedHash, sMessage, i;
if (sHash !== HashHack.sLastHash) {
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function NORMDIST(x, mean, sd, cumulative) {
// Check parameters
if (isNaN(x) || isNaN(mean) || isNaN(sd)) return '#VALUE!';
if (sd <= 0) return '#NUM!';
// Return normal distribution computed by jStat [http://jstat.org]
return (cumulative) ? jStat.normal.cdf(x, mean, sd) : jStat.normal.pdf(x, mean, sd);
}
# -*- coding: utf-8 -*-
require 'rubygems'
require 'RMagick'
filename = ARGV.first
unless filename
warn "usage: #{$0} <ANIMATION GIF FILE>"
exit 1
end
# Funciona perfeitamente bem
<% cache "tags", skip_digest: true do %>
<% current_user.each do |tag| %>
<%= tag.name %>
<% end %>
<% end %>
# Simplesmente não renderiza nada
<% cache ["tags", current_user], skip_digest: true do %>
@dayvsonlima
dayvsonlima / install-redis.sh
Created October 22, 2015 11:10 — forked from dstroot/install-redis.sh
Install Redis on Amazon EC2 AMI
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@dayvsonlima
dayvsonlima / gist:0f4a64b4679cb597a9cc
Created October 26, 2015 12:48 — forked from edvinasbartkus/gist:0e99ea8305a20737f562
Ruby puma.gem install on El Capitan
gem install puma -- --with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib
RSpec.describe PagesController, type: :controller do
describe '#destroy' do
context 'when invalid scenario' do
context 'and resource is not found' do
# setup...
let() {...}
let() {...}
let() {...}
subject {}