Skip to content

Instantly share code, notes, and snippets.

View huseyin's full-sized avatar

Hüseyin Tekinaslan huseyin

View GitHub Profile
@oxUnd
oxUnd / cal.go
Last active September 24, 2020 10:44
Tiny calculator use golang
//
// 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
@roktas
roktas / denizli.rb
Last active March 10, 2016 11:44
Test üreteci
#!/usr/bin/env ruby
require 'yaml'
require 'forwardable'
module MultipleChoice
module Choice
CHOICES = (:a..:e).to_a
refine Symbol do
# munge PATH
pathmunge() {
case ":${PATH}:" in *:"$1":*) return 0 ;; esac
[ "$2" = after ] && PATH=$PATH:$1 || PATH=$1:$PATH
}
@db0sch
db0sch / regenerate_credentials.md
Last active July 30, 2024 12:59
How to regenerate the master key for Rails 5.2 credentials

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.

  1. Copy content of original credentials rails credentials:show somewhere temporarily.
  2. Remove config/master.key and config/credentials.yml.enc
  3. Run EDITOR=vim rails credentials:edit in the terminal: This command will create a new master.key and credentials.yml.enc if they do not exist.
  4. Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
  5. Add and Commit the file config/credentials.yml.enc