Skip to content

Instantly share code, notes, and snippets.

:shipit:
Ship it!

Ricardo Shiota Yasuda shadowmaru

:shipit:
Ship it!
Block or report user

Report or block shadowmaru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shadowmaru
shadowmaru / db-open
Created Mar 6, 2017 — forked from helderco/db-open
Script to open a mysql database in Sequel Pro from a service in docker-compose.
View db-open
#!/bin/bash
set -e
show_help() {
cat << EOF
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE]
${0##*/} -h
Open a standard connection in Sequel PRO.
@shadowmaru
shadowmaru / layout_style_guide.md
Last active Feb 26, 2018
Layout Style Guide Bio Ritmo
View layout_style_guide.md

Guia de estilos para layouts de websites - Grupo Bio Ritmo

Formato do layout

Entregue seu layout no formato Photoshop. Também inclua jpegs caso haja muitas variações do responsivo (break points).

Peso dos arquivos

Evite arquivos muito grandes, principalmente as imagens. Otimize-as para web e principalmente para mobile.

View angular-directive.js
'use strict';
angular.module('app')
.directive('my-input', [
function() {
return {
restrict: 'E',
templateUrl: '/my-input.html',
scope: {},
controllerAs: 'myInput',
View keybase.md

Keybase proof

I hereby claim:

  • I am shadowmaru on github.
  • I am shadowmaru (https://keybase.io/shadowmaru) on keybase.
  • I have a public key whose fingerprint is 16BD 33FB D8C8 541D D751 64D2 4146 8958 61AA 4F17

To claim this, I am signing this object:

View gist:1706208
deploy 7546 0.0 0.0 17724 656 ? S 22:41 0:00 -bash
deploy 7605 0.0 0.0 17724 640 ? S 22:42 0:00 -bash
deploy 7609 0.0 0.0 17724 664 ? S 22:42 0:00 -bash
deploy 7628 0.0 0.0 17724 668 ? S 22:42 0:00 -bash
deploy 7674 0.0 0.0 17724 668 ? S 22:43 0:00 -bash
deploy 7675 0.0 0.0 17724 668 ? S 22:43 0:00 -bash
deploy 7676 0.0 0.0 17724 672 ? S 22:43 0:00 -bash
deploy 7679 0.0 0.0 17724 676 ? S 22:43 0:00 -bash
deploy 7680 0.0 0.0 17724 672 ? S 22:43 0:00 -bash
deploy 7684 0.0 0.0 17724 672 ? S 22:43 0:00 -bash
View devise.pt-BR.yml
pt-BR:
errors:
messages:
expired: "expirou, por favor solicite uma nova"
not_found: "não encontrado"
already_confirmed: "já foi confirmado, por favor tente fazer login"
not_locked: "não foi bloqueado"
not_saved:
one: "1 erro evitou que este %{resource} fosse gravado:"
other: "%{count} erros evitaram que este %{resource} fosse gravado:"
View migrate_products_to_paperclip.rb
class MigrateProductsToPaperclip < ActiveRecord::Migration
def self.up
# Rename the old "image" column to "old_file_name", since Product.image will now try to do Paperclip stuff
rename_column :products, :image, :old_file_name
# Rename asset directories to pluralize
File.rename("public/system/product","public/system/products")
File.rename("public/system/products/image","public/system/products/images")
View gist:340696
class UserPasswordCryptMD5
def self.encrypt(*tokens)
Digest::MD5.hexdigest(*tokens)
end
def self.matches?(crypted_password, *tokens)
encrypt(*tokens) == crypted_password
end
end
View gist:340694
acts_as_authentic do |c|
c.transition_from_crypto_providers = [UserPasswordCryptSHA, UserPasswordCryptMD5]
end
You can’t perform that action at this time.