Code Monkey home page Code Monkey logo

synthesis's Introduction

About synthesis

Synthesis is a zsh script for emulating a coding style with higher order functions, lambdas and composition in the shell.

A fizzbuzz in synthesis would look like this:

fizzes=77 # however many iterations we want

⛥ seql $fizzes ⇝ partition mod 15 \
			⇝ partmap 3:6:9:12 enter '«fizz»' \
			⇝ partmap 5:10 enter '«buzz»' \
			⇝ partmap 0 enter '«fizz buzz»' \
			⇝ unify ⇝ ◎ 

The following code creates/updates backup files of text files belonging to the user that were accessed within the last two days:

⛥ detect '«./*.txt»' mine lastacc -2 \
			⇝ map x '«cp -- $x $x.bak»'

The unicode symbols have two-keystroke keymaps for ease of input, as well as suggested non-unicode replacements. For instance, ⛥ is inserted with `q (backtick-q) and the pipe arrow ⇝ with `p.

The script was created for my personal use, inspired by previous efforts to provide functional templates in the shell, and then expanded into a more generic tool over the course of the last few months. It is an amateur project so please be very careful if you decide to use it.

For more information, credits, caveats etc, check the documentation in documentation.md. Both the script and the documentation are works in progress.

Illustrated Use

Hello World

Hello World

Simple file generation

File generation

User-defined functions

User defined functions

File actions

File actions

Buffer structure

Buffer structure

Longest words in a list

Buffer structure

Average GPA of popular major

Buffer structure

Formatting and display

Buffer structure

Installation

Clone this repository locally and source the file synthesis.zsh. Note that the file contains escape sequences for some of the keybindings in order to reposition the cursor; looking at the raw file from the browser, these sequences are stripped off. If the keybindings `1 and `2 do not properly position the cursor in the center of the brackets, you need to supply these keystrokes at the bindkeys near the end of the file.

The documentation has more information on the prerequisites and first steps into this environment.

synthesis's People

Contributors

ykonstant1 avatar

Stargazers

Lucas Burns avatar

Watchers

 avatar

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.