Skip to content

Instantly share code, notes, and snippets.

View frankyston's full-sized avatar
🎯
Ruby on Rails is Fun

Frankyston Lins frankyston

🎯
Ruby on Rails is Fun
View GitHub Profile
@frankyston
frankyston / rage.js
Created October 30, 2020 01:29
Mais macros
// DISCLAIMER: This macro is an evolved version of the original D&D 5e Rage Macro masterwork written by Felix#6196.
// Norc#5108 is now maintaining this macro along with continued support from Felix.
//
//
// UPDATES: 1. Fixed errors resulting from declarations of "actor" and "token" in a script macro.
// Added automatic Totem Spirit: Bear detection and resistance application
// Added error messages for trying to rage with no token or no barbarian selected
// 2. (Felix) Added resource/usage deduction and errors (re-added after accidentally overwriting the addition)
// Fixed rage damage at level 8
// 3. (2020/05/30) "Version 2.0"
@frankyston
frankyston / rollwithimage.js
Created October 14, 2020 14:28
Macro para aplicar imagem na rolagem de dados.
let image = 'https://media.giphy.com/media/3o7TKMCv3R3zeB3FzG/giphy.gif'
let title = 'Machado Machadão'
let chatMsg = `<h1>${title}</h1><img src='${image}'><br>`
let chatData = {
user: game.user._id,
speaker: ChatMessage.getSpeaker(),
content: chatMsg
};
@frankyston
frankyston / acerto_critico.js
Last active April 22, 2021 23:02
Script para rolar tabela no foundry.
const name = "t20-SC";
const table = game.tables.entities.find(t => t.name === name);
table.draw();
@frankyston
frankyston / controller_macros.rb
Created September 16, 2020 19:12 — forked from saboyutaka/controller_macros.rb
Rspec spec/support files.
module ControllerMacros
def login_user
before(:each) do
@request.env["devise.mapping"] = Devise.mappings[:user]
user = FactoryGirl.create(:user)
user.confirm!
sign_in user
end
end
end
@frankyston
frankyston / smtp_login_auth.go
Created September 13, 2020 14:49 — forked from andelf/smtp_login_auth.go
golang net/smtp SMTP AUTH LOGIN Auth Handler
// MIT license (c) andelf 2013
import (
"net/smtp"
"errors"
)
type loginAuth struct {
username, password string
@frankyston
frankyston / README.md
Created July 2, 2020 21:08 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

2.hours.ago # => Fri, 02 Mar 2012 20:04:47 JST +09:00
1.day.from_now # => Fri, 03 Mar 2012 22:04:47 JST +09:00
Date.today.to_time_in_current_zone # => Fri, 02 Mar 2012 22:04:47 JST +09:00
Date.current # => Fri, 02 Mar
Time.zone.parse("2012-03-02 16:05:37") # => Fri, 02 Mar 2012 16:05:37 JST +09:00
Time.zone.now # => Fri, 02 Mar 2012 22:04:47 JST +09:00
Time.current # Same thing but shorter. (Thank you Lukas Sarnacki pointing this out.)
Time.zone.today # If you really can't have a Time or DateTime for some reason
Time.zone.now.utc.iso8601 # When supliyng an API (you can actually skip .zone here, but I find it better to always use it, than miss it when it's needed)
Time.strptime(time_string, '%Y-%m-%dT%H:%M:%S%z').in_time_zone(Time.zone) # If you can't use Time#parse
@frankyston
frankyston / things-i-believe.md
Created March 7, 2020 03:13 — forked from stettix/things-i-believe.md
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

function! UseTabs()
set tabstop=4 " Size of a hard tabstop (ts).
set shiftwidth=4 " Size of an indentation (sw).
set noexpandtab " Always uses tabs instead of space characters (noet).
set autoindent " Copy indent from current line when starting a new line (ai).
endfunction
function! UseSpaces()
set tabstop=2 " Size of a hard tabstop (ts).
set shiftwidth=2 " Size of an indentation (sw).