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
// | |
// Tiny calculator | |
// | |
// cal := modules.NewCal() | |
// fmt.Println(cal.MustCal("1x1+4/2x(1+2)")) | |
// result, err := cal.Cal("1x1+4/2x(1+2)") | |
// fmt.Println(cal.GetPostfixExpr("1x1+4/2x(1+2)")) | |
// | |
package modules |
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
#!/usr/bin/env ruby | |
require 'yaml' | |
require 'forwardable' | |
module MultipleChoice | |
module Choice | |
CHOICES = (:a..:e).to_a | |
refine Symbol do |
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
# munge PATH | |
pathmunge() { | |
case ":${PATH}:" in *:"$1":*) return 0 ;; esac | |
[ "$2" = after ] && PATH=$PATH:$1 || PATH=$1:$PATH | |
} |
If your master.key has been compromised, you might want to regenerate it.
No key regeneration feature at the moment. We have to do it manually.
- Copy content of original credentials
rails credentials:show
somewhere temporarily. - Remove
config/master.key
andconfig/credentials.yml.enc
- Run
EDITOR=vim rails credentials:edit
in the terminal: This command will create a newmaster.key
andcredentials.yml.enc
if they do not exist. - Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
- Add and Commit the file
config/credentials.yml.enc
OlderNewer