Coder Social home page Coder Social logo

pmz's Introduction

Hi, welcome to my GitHub Page ๐Ÿ‘‹

Here you can find a brief summary of myself. Will try to keep this regularly updated, as well as the pinned repositories so you can know what things I have beeb working on lately.

Thanks for stopping by. If you would like to, you can buy me some coffee.

๐Ÿค– Tech stuff:

  • Software Developer with a focus on cyber security. Working now as an AppSec Engineer, mostly building tools, CLIs and automation to secure the software development lifecycle.

  • Occasional security researcher, eternal reverse engineering learner.

  • Python and Go connoisseur. I try to pick the best tool for the trade.

  • Passionate and contributor of open source software.

  • Sometimes I share my thoughts and experiences in my website but I don't do it as often as I should!

  • If you want to reach out to me, you can do it on Twitter, or Mastodon, or on LinkedIn.

๐Ÿง‘โ€๐Ÿฆฑ๐Ÿ‘‹ The human part:

  • Born and raised in Porto, Portugal ๐Ÿ‡ต๐Ÿ‡น.

  • I speak Portuguese and English.

  • Other things I care for in life:

    • Brazillian Jiu-jitsu ๐Ÿฅ‹
    • Reading (about tech, security, software development and personal productivity).
    • Music is a passion and used to be a side gig.

pmz's People

Contributors

augustasv avatar dependabot[bot] avatar gsilvapt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pmz's Issues

feat: test suite

Write a test suite to ensure commands work as expected.

References: https://clavinjune.dev/en/blogs/implement-unit-test-for-cli-apps-using-golang-and-cobra/

New command

  • new command should create a new file
  • new --title flag should create a new file and the title should exist in the file. Not sure how to handle this with custom templates, but yea... Also a good chance to test errors.

Search command

  • provided no notes, search returns nothing
  • provided a few notes, search can return content in those notes that match the query

template issue

Hi, insalled pmz, configured ~/.pmz.yaml to mention ztldir: /Users/<username>/zettle and ran pmz new. It gives the following error.

Failed to write template to new note, but it should exist for you.
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1102e19]

goroutine 1 [running]:
text/template.errRecover(0xc000117ba0)
	/usr/local/go/src/text/template/exec.go:163 +0x15b
panic({0x12aee20, 0x152e290})
	/usr/local/go/src/runtime/panic.go:1038 +0x215
text/template.(*Template).execute(0x0, {0x135a440, 0xc0000ae0c8}, {0x12b2740, 0x156dd80})
	/usr/local/go/src/text/template/exec.go:214 +0x239
text/template.(*Template).Execute(...)
	/usr/local/go/src/text/template/exec.go:200
github.com/gsilvapt/pmz/cmd.writeToNewNote(0xc0000b4198, {0x0, 0x0})
	/Users/<username>/go/pkg/mod/github.com/gsilvapt/[email protected]/cmd/new.go:90 +0xf1
github.com/gsilvapt/pmz/cmd.glob..func1(0x1534c00, {0x12ec824, 0x0, 0x0})
	/Users/<username>/go/pkg/mod/github.com/gsilvapt/[email protected]/cmd/new.go:52 +0x354
github.com/spf13/cobra.(*Command).execute(0x1534c00, {0x156c970, 0x0, 0x0})
	/Users/<username>/go/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0x1534e80)
	/Users/<username>/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/<username>/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/gsilvapt/pmz/cmd.Execute()
	/Users/<username>/go/pkg/mod/github.com/gsilvapt/[email protected]/cmd/root.go:50 +0x25
main.main()
	/Users/<username>/go/pkg/mod/github.com/gsilvapt/[email protected]/main.go:21 +0x17

It created /Users/<username>/zettle/2021113316/README.md, but well, it did not open the directory or the file. I did not find anything in readme, though inspecting the source suggests it is expecting a template file for the zettle readme? Can you please update the readme to suggest how it should be used?

Implement a tagging system for notes

Somehow find a way to create a tagging system for notes. Although I don't have a standard to recommend, something like YAML front matter could work well, as it contains enough information in there to implement things like date range search (#10), tags (this issue) and potentially other features further down the road.

This could easily scale in complexity though, as this issue is then multiple folded. At least, the following three items have to be fulfilled:

  1. Implement a metadata parser to parse all note's metadata.
  2. Script to automatically add metadata to each note.
  3. Add to template suggestion in this repository to contain YAML front matter, which can leverage Go's templating system, so that all new notes will contain metadata.

If users decide to not use metadata, then some features may be compromised. Does it make sense to force all notes to use this metadata?

Standardize variable names

Too many years writing Python makes me still use snake case sometimes. Example:

pmz/cmd/new.go

Line 43 in 6abddbd

tmpl_path := viper.GetString("notetemplate")

Please review all variables names to ensure they all follow Go's ways (in this case, camelCase).

feat: Allow different commit message

New feature

Something like pmz save --message "" would add custom commit message.

Current behaviour

By default there is no option to change commit message
Default message updating your zettelkasten could be used if --message is not specified.

Commits signed by gpg key

It would be great if there were an option to make commits signed by a GPG key, so they would appear verified.

Failed reading config file error

I would like to use this tool, but getting Failed reading onfig file error

ERROR: 2022/01/12 21:12:20 /home/namai/go/pkg/mod/github.com/gsilvapt/[email protected]/internal/logs/logger.go:45: Failed reading config file: 
โžœ  bin pmz -v    
pmz version 0.3
โžœ  bin pmz update
ERROR: 2022/01/12 21:12:35 /home/namai/go/pkg/mod/github.com/gsilvapt/[email protected]/internal/logs/logger.go:45: Failed reading config file: ```

Improve search capabilities

  • Allow searching case sensitive keywords
  • Allow searching full file contents instead of just title
  • Allow searching in date ranges, since the main directories are a timestamp.
  • Allow searching for tags, which will require implementing a tagging system for the notes (created its own issue for better tracking in #42)

Each feature can (actually, it should) be a separate branch/PR.

feat: add simple github action CI pipeline

The goal is to implement an easy CI/CD pipeline to run on each new pull request. Something as simple as:

  • Run test suites, build commands and break if any fails.in the process.
  • Publish new version when merge request is accepted/merged.

Replace `PanicIfError` with a proper logger

It felt like a good idea at first, but PanicIfError it's awful.

Let's replace this utility function with a logging feature instead. It should still exit, but output should be less scary. No major requirements at this stage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.