Blog

  • hvTerrain

    What

    hvTerrain is a terrain shader for URP I ended up making for my game. I got inspired by KUF2 terrain system (ps only, no clipmap stuff).

    This is not a total replacement to Unity’s terrain shader. You should still use it for painting/viewing in-editor. Use hvTerrain once you finish your terrain and want more performance in-game. Baking is not destructive to original terrain.

    I got a lot of help from around the web, forums and gamedev communities in general, so I decided to release it under MIT.

    Also, it’s not production ready as I haven’t tested it fully yet. Give it a try and tell me how it goes.

    Features

    • Pros
      • up to 256 textures
      • triplanar
      • per pixel normals
      • holes support
      • should be more perfomant than Unity’s Terrain
        • specially when using lots of textures
        • also, when NOT using triplanar
      • normal blending is correct (no multi-pass hacks)
    • Cons
      • no ‘Draw Instanced’ support (Shader graph issue I guess)
      • needs baking
      • layers blend not so smooth
      • use of Texture2DArray
        • it might not work on some old devices
        • it requires same-sized textures
        • no compression
        • also needs manual handling per Graphics API (so I was told, haven’t tested on mobiles yet)

    Why

    Because Unity’s Terrain frag shader is slow, specially when you need lots of textures, as it relies on control maps (or alpha maps / splat maps). It means that every 4 textures the terrain has to ‘re-render’.

    For example, lets say we have 16 layers (albedo + normals):

    • 4 * [n of passes] draw calls per terrain patch
    • 4 samples for control maps
    • 16 albedo samples + 16 normal samples
    • what if we want triplanar ?
      • then we get 3 * 32 + 4 = 100 samples per pixel
      • and most of the sampled textures don’t even contribute

    How it works

    It actually is more of a baking system than a shader. It works by baking Unity’s Terrain data to textures.

    I believe the shader ends up being a ‘constant-cost’ shader giving the sample count is mostly constant.

    It should also have a higher overhead compared to Unity’s terrain shader though, since it is always going to sample 2 blendMaps + 8 albedos + 4 normals (if not using triplanar).

    So for terrains with <= 4 textures, Unity’s terrain shader should be more efficient.

    Here is the rundown:

    • Bakes Terrain layers to Texture2DArrays
      • currently only bakes albedo_smooth + normalsTS_rg
      • also bakes layer’s normalScale and smoothness factors into textures
        • scaling normals to a texture might be bad a idea, need to test that more
      • bakes tile sizes to an array (_TexturesScale)
    • Bakes SplatMaps to a texture called BlendMap0
      • blendMap0 channel layout = (id0, id1, weight, alpha)
        • alpha is a bitMask = [00000bxz] (applyBilinear isX isZ)
      • it supports blending up to 2 textures
      • axis is used for ‘triplanar’ (see KUF2 presentation)
      • ids need manual bilinear filtering on ps
      • normal mapping uses id0 only (for perf)
    • Bakes Terrain surface data (normals + triplanar axis blend zones) to BlendMap1
      • blendMap1 channel layout = (x, y, z, axisBlend)
        • axisBlend is used for more efficient triplanar mapping
        • it’s a mask used to perform triplanar only at seam areas

    In the PS:

    • branch on blendMap0.a to decide to use bilinear or not
    • branch on blendMap1.a to decide to use triplanar or not

    So, if my math is right:

    Best-case scenario:

    • no bilinear
    • no triplanar
    • 2 blendMap (BlendMap0 + BlendMap1)
    • 2 albedo (id0 + id1) (sometimes id0 == id1 so this could get cache optimized too)
    • 1 normal (id0)
    • Totals to 5 samples

    Average-case scenario:

    • bilinear
    • no triplanar
    • 5 blendMap (4 * BlendMap0 + BlendMap1)
    • 4 * 2 * albedo (4 * (id0 + id1))
    • 4 * normal (only id0)
    • Totals to 17 samples

    Worst-case scenario:

    • bilinear
    • triplanar
    • triplanar = 17 * 3 (for each axis)
    • Totals to 51 samples

    Worst case is present at places where uv axis change (surface edges/ridges etc).

    How to use

    • Add hvTerrain component to a terrain gameobject
    • Create a Unity Terrain material
    • Create a hvTerrain material
    • Assign materials to the hvTerrain component
    • Create/Paint terrain as you normaly would
      • you can swtich materials by hvTerrain -> context menu -> switch material
      • you obviously should use Unity Terrain material while painting/sculpting for realtime preview
    • Bake (hvTerrain -> contex menu -> bake)
    • You can switch features on/off at the hvTerrain material
    • Enabling/Disabling holes is a bit tricky
      • Make sure you enable ‘Alpha Clipping’ at shader graph + ‘Holes’ checkbox (also ‘Terrain Holes’ at the URPSettings asset)

    More Images

    Visit original content creator repository https://github.com/hickVieira/hvTerrain
  • go-rest-api-orm

    GO-REAT-API-ORM

    Description

    This repository is a REST API with GO, Mux and SQLite.

    Installation

    Using GO, SQLite, CompileDaemon,etc preferably.

    DataBase

    Using SQLite preferably.

    Apps

    Using Postman or RestEasy to feed the api.

    Usage

    $ git clone https://github.com/DanielArturoAlejoAlvarez/go-rest-api-orm.git
    [NAME APP]

    Follow the following steps and you’re good to go! Important:

    alt text

    Coding

    Controllers

    ...
    package main
    
    import (
    	"fmt"
    	"log"
    	"net/http"
    
    	"github.com/gorilla/mux"
    )
    
    func helloWorld(w http.ResponseWriter, r *http.Request) {
    	fmt.Fprintf(w, "<h1>Hello World!</h1>")
    }
    
    func handleRequests() {
    	router := mux.NewRouter().StrictSlash(true)
    	router.HandleFunc("/users", getUsers).Methods("GET")
    	router.HandleFunc("/users/{name}", getUser).Methods("GET")
    	router.HandleFunc("/users/{name}/{email}", saveUser).Methods("POST")
    	router.HandleFunc("/users/{name}/{email}", updateUser).Methods("PUT")
    	router.HandleFunc("/users/{name}", deleteUser).Methods("DELETE")
    	router.HandleFunc("https://github.com/", helloWorld).Methods("GET")
    	log.Fatal(http.ListenAndServe(":5500", router))
    }
    
    func main() {
    	fmt.Println("Welcome to REST API with ORM")
    
    	InitialMigration()
    	handleRequests()
    }
    ...

    Models

    ...
    package main
    
    import (
    	"encoding/json"
    	"fmt"
    	"net/http"
    
    	"github.com/gorilla/mux"
    
    	"github.com/jinzhu/gorm"
    	_ "github.com/jinzhu/gorm/dialects/sqlite"
    )
    
    var db *gorm.DB
    var err error
    
    //User is esported
    type User struct {
    	gorm.Model
    	Name  string
    	Email string
    }
    
    //InitialMigration is exported
    func InitialMigration() {
    	db, err = gorm.Open("sqlite3", "test_db")
    	if err != nil {
    		fmt.Println(err.Error())
    		panic("Failed connect DB!")
    	}
    	defer db.Close()
    
    	db.AutoMigrate(&User{})
    }
    
    func getUsers(w http.ResponseWriter, r *http.Request) {
    	db, err = gorm.Open("sqlite3", "test_db")
    	if err != nil {
    		fmt.Println(err.Error())
    		panic("Failed connect DB!")
    	}
    	defer db.Close()
    
    	var users []User
    
    	db.Find(&users)
    	w.Header().Set("Content-Type", "application/json")
    	json.NewEncoder(w).Encode(users)
    }
    
    func getUser(w http.ResponseWriter, r *http.Request) {
    	db, err = gorm.Open("sqlite3", "test_db")
    	if err != nil {
    		fmt.Println(err.Error())
    		panic("Failed connect DB!")
    	}
    	defer db.Close()
    
    	vars := mux.Vars(r)
    	name := vars["name"]
    
    	var user User
    	db.Where("name = ?", name).Find(&user)
    
    	db.Find(&user)
    	w.Header().Set("Content-Type", "application/json")
    	json.NewEncoder(w).Encode(user)
    }
    
    func saveUser(w http.ResponseWriter, r *http.Request) {
    	db, err = gorm.Open("sqlite3", "test_db")
    	if err != nil {
    		fmt.Println(err.Error())
    		panic("Failed connect DB!")
    	}
    	defer db.Close()
    
    	vars := mux.Vars(r)
    	name := vars["name"]
    	email := vars["email"]
    
    	db.Create(&User{Name: name, Email: email})
    
    	fmt.Fprintf(w, "User saved successfully!")
    }
    
    func updateUser(w http.ResponseWriter, r *http.Request) {
    	db, err = gorm.Open("sqlite3", "test_db")
    	if err != nil {
    		fmt.Println(err.Error())
    		panic("Failed connect DB!")
    	}
    	defer db.Close()
    
    	vars := mux.Vars(r)
    	name := vars["name"]
    	email := vars["email"]
    
    	var user User
    	db.Where("name = ?", name).Find(&user)
    
    	user.Email = email
    	db.Save(&user)
    
    	fmt.Fprintf(w, "User updated successfully!")
    }
    
    func deleteUser(w http.ResponseWriter, r *http.Request) {
    	db, err = gorm.Open("sqlite3", "test_db")
    	if err != nil {
    		fmt.Println(err.Error())
    		panic("Failed connect DB")
    	}
    	defer db.Close()
    
    	vars := mux.Vars(r)
    	name := vars["name"]
    
    	var user User
    	db.Where("name = ?", name).Find(&user)
    	db.Delete(&user)
    
    	fmt.Fprintf(w, "User deleted successfully!")
    }
    ...

    Contributing

    Bug reports and pull requests are welcome on GitHub at https://github.com/DanielArturoAlejoAlvarez/go-rest-api-orm. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

    License

    The gem is available as open source under the terms of the MIT License.

    Visit original content creator repository https://github.com/DanielArturoAlejoAlvarez/go-rest-api-orm
  • react-native-expo-fancy-alerts

    React Native Fancy Alerts

    NPM version Downloads License

    Adaptation of nativescript-fancyalert for react native. Compatible with expo 🤓

    Screenshot loading Screenshot success Screenshot error

    Quick Start

    $ npm i react-native-expo-fancy-alerts

    Or

    $ yarn add react-native-expo-fancy-alerts
    import React from 'react';
    import { Text, TouchableOpacity, View } from 'react-native';
    import { FancyAlert } from 'react-native-expo-fancy-alerts';
    
    const App = () => {
      const [visible, setVisible] = React.useState(false);
      const toggleAlert = React.useCallback(() => {
        setVisible(!visible);
      }, [visible]);
    
      return (
        <View>
          <TouchableOpacity onPress={toggleAlert}>
            <Text>Tap me</Text>
          </TouchableOpacity>
    
          <FancyAlert
            visible={visible}
            icon={<View style={{
              flex: 1,
              display: 'flex',
              justifyContent: 'center',
              alignItems: 'center',
              backgroundColor: 'red',
              borderRadius: 50,
              width: '100%',
            }}><Text>🤓</Text></View>}
            style={{ backgroundColor: 'white' }}
          >
            <Text style={{ marginTop: -16, marginBottom: 32 }}>Hello there</Text>
          </FancyAlert>
        </View>
      )
    }
    
    export default App;

    Reference

    LoadingIndicator

    Property Type Required Default Description
    visible bool yes n/a Whether the loading indicator should be shown

    FancyAlert

    Property Type Required Default Description
    visible bool yes n/a Whether the alert should be visible
    icon node yes n/a The icon to show in the alert
    style object no {} Like your usual style prop in any View
    onRequestClose func no () => void The action to run when the user taps the button
    • NOTE – Alerts are not dismissed by tapping the blurry background

    Examples

    The following example illustrates how you can create a loading indicator for your entire app. If you’re using redux you may have a part of your store which says whether you’re loading something, you can get that flag and show one of the loading indicators offered by this lib.

    import React from 'react';
    import { useSelector } from 'react-redux';
    import { LoadingIndicator } from 'react-native-expo-fancy-alerts';
    import { selectIsLoading } from 'selectors';
    
    const AppLoadingIndicator = () => {
      const isLoading = useSelector(selectIsLoading);
      return <LoadingIndicator visible={isLoading} />;
    }
    
    export default AppLoadingIndicator;

    This next one is an error message that is also managed globally through redux.

    import React from 'react';
    import { Platform, Text, View, StyleSheet } from 'react-native';
    import { useDispatch, useSelector } from 'react-redux';
    import { FancyAlert } from 'react-native-expo-fancy-alerts';
    import { Ionicons } from '@expo/vector-icons';
    import { ErrorCreators } from 'creators';
    import { selectError } from 'selectors';
    
    const AppErrorModal = () => {
      const dispatch = useDispatch();
      const { hasError, error } = useSelector(selectError);
    
      const onRequestClose = React.useCallback(
        () => {
          dispatch(ErrorCreators.hideError());
        },
        [dispatch],
      );
    
      return <FancyAlert
        style={styles.alert}
        icon={
          <View style={[ styles.icon, { borderRadius: 32 } ]}>
            <Ionicons
              name={Platform.select({ ios: 'ios-close', android: 'md-close' })}
              size={36}
              color="#FFFFFF"
            />
          </View>
        }
        onRequestClose={onRequestClose}
        visible={hasError}
      >
        <View style={styles.content}>
          <Text style={styles.contentText}>{error ? error.message : ''}</Text>
    
          <TouchableOpacity style={styles.btn} onPress={onPress}>
            <Text style={styles.btnText}>OK</Text>
          </TouchableOpacity>
        </View>
      </FancyAlert>;
    }
    
    const styles = StyleSheet.create({
      alert: {
        backgroundColor: '#EEEEEE',
      },
      icon: {
        flex: 1,
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#C3272B',
        width: '100%',
      },
      content: {
        display: 'flex',
        flexDirection: 'column',
        justifyContent: 'center',
        alignItems: 'center',
        marginTop: -16,
        marginBottom: 16,
      },
      contentText: {
        textAlign: 'center',
      },
      btn: {
        borderRadius: 32,
        display: 'flex',
        flexDirection: 'row',
        justifyContent: 'center',
        alignItems: 'center',
        paddingHorizontal: 8,
        paddingVertical: 8,
        alignSelf: 'stretch',
        backgroundColor: '#4CB748',
        marginTop: 16,
        minWidth: '50%',
        paddingHorizontal: 16,
      },
      btnText: {
        color: '#FFFFFF',
      },
    });
    
    export default AppErrorModal;

    Changelog

    • 0.0.1 – Initial implementation – has layout issues on Android that WILL be fixed
    • 0.0.2 – Android issue fixed
    • 0.0.3 – Added extra customization options
    • 1.0.0 – Years later I decided to package everything and release 🎉🥳
    • 2.0.0 – BREAKING CHANGES Updated FancyAlert to be more intuitive and more generic
    • 2.0.1 – Updated docs to include some real-life examples
    • 2.0.2 – Updated dependencies
    • 2.1.0 – Added typescript typings
    Visit original content creator repository https://github.com/mrnkr/react-native-expo-fancy-alerts
  • react-widgets

    React Widgets

    Table of Contents

    Technologies Used

    • React.js – Frontend JavaScript library
    • Webpack – Module bundler
    • @babel/core – JavaScript coverter for backwards compatibility
    • Geolocation API – Request user’s current location and
    • Open Weather API – Fetch free weather data for the user’s location

    Widgets

    Clock

    The Clock component displays the current date and time, updating every second.

    • Date
      • Weekday (full length)
      • Month (full length)
      • Calendar date (two digit integer)
    • Time
      • Seconds, minutes, and hours (in 12-hour format)
      • AM/PM indicator


    Weather

    The Weather component provides local weather data in an organized and digestible fashion. Weather data includes:

    • Description
      • Short description of the current weather conditions along with a relevant icon
      • Current location being used for weather data
    • Temperatures (all in fahrenheit)
      • feelsLike – what it currently ‘feels like’
      • actual – what the actual current temperature is
      • max and min – highest and lowest temperatures for the current date
    • Wind
      • Directional arrow icon that is rotated based on the current direction of wind
      • Two letter abbreviations for the compass direction of the current wind
      • Speed of current wind (imperial miles/hr)
      • Gusts (imperial miles/hr), only if there are high wind gusts in the forecast


    AutoComplete

    The AutoComplete component filters a list of names based on the user’s input. Matches are detected by comparing the user’s input to the list of names, each sliced to the length of input and checked for equality. When a user clicks on the recommended name, the field autocompletes the name and displays the company’s data below the search bar.

    • Suggestions
      • Absolute positioned list of company names recommened based on user’s input
      • onClick event handler to complete the search and render the company data
    • Dynamic Lists
      • The array of names suggested are provided as props, and therefore can easily be changed
      • Format of the company names accepted as props:
        [{ name: "Apple", revenue: "$274.5 B" }, ...]

    autocomplete-widget


    Tabs

    The Tabs widget is an interactive container that dynamically displays content based on the label selected by the user.

    • Dynamic Props
      • Tabs are passed as props formatted as an array objects, each with a title (string) and content (React Components or HTML Elements):
      [{title: "Weather", content: <Weather type='tab' />}, ...]
    • Active Tabs
      • Selected tab index stored in component’s state
      • The actively selected tab is styled with a blue background, box-shadow, and bold text


    Visit original content creator repository https://github.com/jacobbenowitz/react-widgets
  • renovate-config

                                     Apache License
                               Version 2.0, January 2004
                            http://www.apache.org/licenses/
    
       TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
    
       1. Definitions.
    
          "License" shall mean the terms and conditions for use, reproduction,
          and distribution as defined by Sections 1 through 9 of this document.
    
          "Licensor" shall mean the copyright owner or entity authorized by
          the copyright owner that is granting the License.
    
          "Legal Entity" shall mean the union of the acting entity and all
          other entities that control, are controlled by, or are under common
          control with that entity. For the purposes of this definition,
          "control" means (i) the power, direct or indirect, to cause the
          direction or management of such entity, whether by contract or
          otherwise, or (ii) ownership of fifty percent (50%) or more of the
          outstanding shares, or (iii) beneficial ownership of such entity.
    
          "You" (or "Your") shall mean an individual or Legal Entity
          exercising permissions granted by this License.
    
          "Source" form shall mean the preferred form for making modifications,
          including but not limited to software source code, documentation
          source, and configuration files.
    
          "Object" form shall mean any form resulting from mechanical
          transformation or translation of a Source form, including but
          not limited to compiled object code, generated documentation,
          and conversions to other media types.
    
          "Work" shall mean the work of authorship, whether in Source or
          Object form, made available under the License, as indicated by a
          copyright notice that is included in or attached to the work
          (an example is provided in the Appendix below).
    
          "Derivative Works" shall mean any work, whether in Source or Object
          form, that is based on (or derived from) the Work and for which the
          editorial revisions, annotations, elaborations, or other modifications
          represent, as a whole, an original work of authorship. For the purposes
          of this License, Derivative Works shall not include works that remain
          separable from, or merely link (or bind by name) to the interfaces of,
          the Work and Derivative Works thereof.
    
          "Contribution" shall mean any work of authorship, including
          the original version of the Work and any modifications or additions
          to that Work or Derivative Works thereof, that is intentionally
          submitted to Licensor for inclusion in the Work by the copyright owner
          or by an individual or Legal Entity authorized to submit on behalf of
          the copyright owner. For the purposes of this definition, "submitted"
          means any form of electronic, verbal, or written communication sent
          to the Licensor or its representatives, including but not limited to
          communication on electronic mailing lists, source code control systems,
          and issue tracking systems that are managed by, or on behalf of, the
          Licensor for the purpose of discussing and improving the Work, but
          excluding communication that is conspicuously marked or otherwise
          designated in writing by the copyright owner as "Not a Contribution."
    
          "Contributor" shall mean Licensor and any individual or Legal Entity
          on behalf of whom a Contribution has been received by Licensor and
          subsequently incorporated within the Work.
    
       2. Grant of Copyright License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          copyright license to reproduce, prepare Derivative Works of,
          publicly display, publicly perform, sublicense, and distribute the
          Work and such Derivative Works in Source or Object form.
    
       3. Grant of Patent License. Subject to the terms and conditions of
          this License, each Contributor hereby grants to You a perpetual,
          worldwide, non-exclusive, no-charge, royalty-free, irrevocable
          (except as stated in this section) patent license to make, have made,
          use, offer to sell, sell, import, and otherwise transfer the Work,
          where such license applies only to those patent claims licensable
          by such Contributor that are necessarily infringed by their
          Contribution(s) alone or by combination of their Contribution(s)
          with the Work to which such Contribution(s) was submitted. If You
          institute patent litigation against any entity (including a
          cross-claim or counterclaim in a lawsuit) alleging that the Work
          or a Contribution incorporated within the Work constitutes direct
          or contributory patent infringement, then any patent licenses
          granted to You under this License for that Work shall terminate
          as of the date such litigation is filed.
    
       4. Redistribution. You may reproduce and distribute copies of the
          Work or Derivative Works thereof in any medium, with or without
          modifications, and in Source or Object form, provided that You
          meet the following conditions:
    
          (a) You must give any other recipients of the Work or
              Derivative Works a copy of this License; and
    
          (b) You must cause any modified files to carry prominent notices
              stating that You changed the files; and
    
          (c) You must retain, in the Source form of any Derivative Works
              that You distribute, all copyright, patent, trademark, and
              attribution notices from the Source form of the Work,
              excluding those notices that do not pertain to any part of
              the Derivative Works; and
    
          (d) If the Work includes a "NOTICE" text file as part of its
              distribution, then any Derivative Works that You distribute must
              include a readable copy of the attribution notices contained
              within such NOTICE file, excluding those notices that do not
              pertain to any part of the Derivative Works, in at least one
              of the following places: within a NOTICE text file distributed
              as part of the Derivative Works; within the Source form or
              documentation, if provided along with the Derivative Works; or,
              within a display generated by the Derivative Works, if and
              wherever such third-party notices normally appear. The contents
              of the NOTICE file are for informational purposes only and
              do not modify the License. You may add Your own attribution
              notices within Derivative Works that You distribute, alongside
              or as an addendum to the NOTICE text from the Work, provided
              that such additional attribution notices cannot be construed
              as modifying the License.
    
          You may add Your own copyright statement to Your modifications and
          may provide additional or different license terms and conditions
          for use, reproduction, or distribution of Your modifications, or
          for any such Derivative Works as a whole, provided Your use,
          reproduction, and distribution of the Work otherwise complies with
          the conditions stated in this License.
    
       5. Submission of Contributions. Unless You explicitly state otherwise,
          any Contribution intentionally submitted for inclusion in the Work
          by You to the Licensor shall be under the terms and conditions of
          this License, without any additional terms or conditions.
          Notwithstanding the above, nothing herein shall supersede or modify
          the terms of any separate license agreement you may have executed
          with Licensor regarding such Contributions.
    
       6. Trademarks. This License does not grant permission to use the trade
          names, trademarks, service marks, or product names of the Licensor,
          except as required for reasonable and customary use in describing the
          origin of the Work and reproducing the content of the NOTICE file.
    
       7. Disclaimer of Warranty. Unless required by applicable law or
          agreed to in writing, Licensor provides the Work (and each
          Contributor provides its Contributions) on an "AS IS" BASIS,
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
          implied, including, without limitation, any warranties or conditions
          of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
          PARTICULAR PURPOSE. You are solely responsible for determining the
          appropriateness of using or redistributing the Work and assume any
          risks associated with Your exercise of permissions under this License.
    
       8. Limitation of Liability. In no event and under no legal theory,
          whether in tort (including negligence), contract, or otherwise,
          unless required by applicable law (such as deliberate and grossly
          negligent acts) or agreed to in writing, shall any Contributor be
          liable to You for damages, including any direct, indirect, special,
          incidental, or consequential damages of any character arising as a
          result of this License or out of the use or inability to use the
          Work (including but not limited to damages for loss of goodwill,
          work stoppage, computer failure or malfunction, or any and all
          other commercial damages or losses), even if such Contributor
          has been advised of the possibility of such damages.
    
       9. Accepting Warranty or Additional Liability. While redistributing
          the Work or Derivative Works thereof, You may choose to offer,
          and charge a fee for, acceptance of support, warranty, indemnity,
          or other liability obligations and/or rights consistent with this
          License. However, in accepting such obligations, You may act only
          on Your own behalf and on Your sole responsibility, not on behalf
          of any other Contributor, and only if You agree to indemnify,
          defend, and hold each Contributor harmless for any liability
          incurred by, or claims asserted against, such Contributor by reason
          of your accepting any such warranty or additional liability.
    
       END OF TERMS AND CONDITIONS
    
       APPENDIX: How to apply the Apache License to your work.
    
          To apply the Apache License to your work, attach the following
          boilerplate notice, with the fields enclosed by brackets "[]"
          replaced with your own identifying information. (Don't include
          the brackets!)  The text should be enclosed in the appropriate
          comment syntax for the file format. We also recommend that a
          file or class name and description of purpose be included on the
          same "printed page" as the copyright notice for easier
          identification within third-party archives.
    
       Copyright [yyyy] [name of copyright owner]
    
       Licensed under the Apache License, Version 2.0 (the "License");
       you may not use this file except in compliance with the License.
       You may obtain a copy of the License at
    
           http://www.apache.org/licenses/LICENSE-2.0
    
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       See the License for the specific language governing permissions and
       limitations under the License.
    

    Visit original content creator repository
    https://github.com/WirePact/renovate-config

  • Youtube-collection-for-learners

    List of youtube channels for Beginners

    Table of Contents

    Javascript

    ReactJS

    NodeJS

    Python

    MERN

    HTML&CSS

    DevOps

    General Videos

    Interview Preparation

    Mobile app

    Visit original content creator repository
    https://github.com/a8hok/Youtube-collection-for-learners

  • algorithmStudy

    ✨ TIL Algorithm

    📌 commit message rule

    • Feat: 새로운 알고리즘 문제 해결
    • Modify: 풀었던 알고리즘 코드 수정
    • Fix: 못 풀었던 문제 해결
    • Comment: 주석 추가 or 수정 or 삭제
    • Refactor: 성능에 관계 없는 코드 배치나 레포 구조 등 수정
    • Docs: 리드미 업데이트

    📌 2023

    날짜 사이트 알고리즘 문제
    12.21 백준 동전 바꿔주기 (🥇)
    12.20 백준 검문 (🥇)
    12.19 백준 색종이와 가위 (🥇)
    12.15 백준 차트 (🥇)
    12.14 백준 사과나무 (🥇)
    12.11 백준 마법사 상어와 토네이도 (🥇)
    12.07 백준 주사위 (🥇)
    12.06 백준 우체국 (🥇)
    12.05 백준 마법사 상어와 파이어볼 (🥇)
    12.01 백준 미세먼지 안녕 (🥇)
    11.24 백준 배 (🥇)
    11.22 백준 센서 (🥇)
    11.21 백준 애너그램 (🥇)
    11.16 백준 문제 추천 시스템 Version1 (🥇)
    11.15 백준 트리의 지름 (🥇)
    11.14 백준 드래곤 앤 던전 (🥇)
    11.13 백준 X와 K (🥇)
    11.08 백준 적의 적 (🥇)
    11.07 백준 입국심사 (🥇)
    11.02 백준 숫자 고르기 (🥇)
    11.01 백준 이분 그래프 (🥇)
    10.31 백준 공유기 설치 (🥇)
    10.29 백준 무한수열 (🥇)
    10.27 백준 농장관리 (🥇)
    10.25 백준 가장 가까운 공통 조상 (🥇)
    10.24 백준 물통 (🥇)
    10.21 백준 약수의 합 (🥇)
    10.20 백준 Two Dots (🥇), 스도쿠 (🥇)
    10.18 백준 공주님을 구해라 (🥇), 내려가기 (🥇)
    09.26 백준 수 묶기 (🥇)
    09.13 백준 키 순서 (🥇)
    09.12 백준 별 찍기 10 (🥇)
    08.29 백준 전깃줄 (🥇)
    08.24 백준 팰린드롬 (🥇)
    08.22 백준 계란으로 계란치기 (🥇)
    08.19 백준 좋다 (🥇)
    08.18 백준 호석이 두 마리 치킨 (🥇)
    08.17 백준 단어수학 (🥇)
    08.11 백준 도시분할계획 (🥇)
    08.10 백준 타일채우기 (🥇) , 도서관 (🥇)
    08.06 백준 가로등 (🥇)
    08.02 백준 오큰수 (🥇)
    08.01 백준 트리 (🥇)
    07.28 백준 징검다리 건너기 (🥈)
    07.27 백준 호텔 (🥇)
    07.26 백준 이진 검색 (🥇)
    07.21 백준 빗물 (🥇)
    07.19 백준 뱀과 사다리 게임 (🥇)
    07.18 백준 겹치는 건 싫어 (🥈)
    07.14 백준 넴모넴모(Easy) (🥇)
    07.12 백준 멍멍이 쓰다듬기 (🥇)
    07.11 백준 플로이드 (🥇)
    07.07 백준 친구비 (🥇) , 여행 가자 (🥇)
    07.06 백준 시간관리 (🥈)
    07.04 백준 LCS (🥇)
    07.03 백준 선수과목 (🥇)
    07.02 소프티어 GBC (Level2)
    06.29 백준 리모컨 (🥇)
    06.26 백준 네트워크 연결 (🥇)
    06.25 백준 헌내기는 친구가 필요해
    06.21 백준 집합의 표현 (🥇)
    06.20 백준 약속 (🥈)
    06.05 백준 PuyoPuyo (🥇)
    04.30 백준 월드컵 (🥇), 거북이 (🥈)
    04.10 백준 iSharp (🥈)
    03.19 백준 뮤탈리스크 (🥇)
    03.18 백준 소형기관차(🥇), 괄호(🥇)
    03.14 벡준 1학년 (🥇)
    03.13 백준 평범한 배낭 (🥇)
    03.07 소프티어 A + B (Level1), 근무 시간 (Level1), 주행거리 비교하기 (Level1)
    03.07 백준 거리 (🥈)
    03.06 백준 크리보드 (🥇)
    03.03 백준 기타리스트 (🥈)
    02.24 백준 1, 2, 3 더하기 4 (🥈)
    02.23 백준 점프 (🥈)
    02.21 백준 퇴사2 (🥇)
    02.06 백준 이모티콘 (🥇)
    02.02 백준 숨바꼭질4 (🥇)
    01.29 백준 숨바꼭질2 (🥇), 숨바꼭질3 (🥇)
    01.20 백준 A->B (🥈)
    01.17 백준 파이프 옮기기 (🥇)
    01.10 백준 가르침 (🥇)
    01.06 백준 바이러스 (🥈)
    01.03 백준 미로 탐색 (🥈), 음식물 피하기 (🥈)


    📌 2022

    날짜 사이트 알고리즘 문제
    12.30 백준 색종이 붙이기 (🥇)
    12.29 백준 감소하는 수 (🥇)
    12.28 백준 전쟁-전투 (🥈)
    12.27 백준 DFS와 BFS (🥈)
    12.26 백준 단지 번호 붙이기 (🥈)
    12.25 백준 괄호 추가하기 (🥇), ⚾ (🥇)
    12.22 백준 줄 세우기 (🥇)
    12.21 백준 스타트와 링크 (🥈)
    12.19 백준 수들의 합 (🥈)
    12.18 백준 상어초등학교 (🥇)
    12.17 백준 컨베이어 벨트 위의 로봇 (🥇)
    12.15 백준 최소 스패닝 트리 (🥇), 최소 비용 구하기 (🥇)
    12.14 백준 동전2 (🥇), 인구이동 (🥇)
    12.13 백준 동전1 (🥇), 톱니바퀴(🥇)
    12.12 백준 사탕게임 (🥈), 로봇청소기 (🥇)
    12.03 백준 부분 문자열🥉
    12.02 SWEA 수영장(모의 SW 역량테스트)
    12.01 백준 멀티탭 스케줄링 🥇
    11.20 SWEA 미생물 격리(모의 SW 역량테스트)
    백준 연산자 끼워넣기 🥈
    11.17 SWEA 방향전환(D4)
    11.16 SWEA 수영대회 결승전(D4)
    11.15 백준 소수 🥈
    SWEA 탈주범 검거(모의 SW 역량테스트), 등산로 조성(모의 SW 역량테스트)
    11.14 백준 쉽게 푸는 문제 🥉
    SWEA 최장경로(D3), 장훈이의 높은 선반(D4), 숫자 만들기(모의 SW 역량테스트)
    11.12 백준 가르침 🥇
    11.11 백준 부분합 🥇
    11.08 백준 N번째 큰 수 🥉
    SWEA 최대 상금(D3)
    11.07 백준 최대공약수와 최소공배수 🥉, 괄호의 값 🥈, 빗물 🥇
    11.03 SWEA 암호생성기(D3), GNS(D3), 회문2(D3)
    11.02 백준 지능형 기차2 🥉
    SWEA 암호문2(D3), 암호문3(D3), 비밀번호(D3)
    11.01 백준 최소 최대 🥉
    SWEA 회문1(D3), 거듭 제곱(D3), 암호문1(D3)
    10.31 백준 일곱 난쟁이🥉
    SWEA 원재의 벽 꾸미기(D3), 원재의 메모리 복구하기(D3), 단순 2진 암호코드(D3)
    10.28 백준 퇴사 🥈
    SWEA 최빈수 구하기(D2)
    10.27 백준 피보나치 수 5 🥉
    SWEA Sum(D3), Flatten(D3), View(D3)
    10.26 백준 이진수🥉
    SWEA 아름이의 돌 던지기(D2), 수도 요금 경쟁(D2), String(D3)
    10.25 백준 약수 구하기 🥉
    SWEA 간단한 소인수분해(D2), 가랏! RC카!(D2), 새로운 불면증 치료법(D2)
    10.24 백준 막대기 🥈
    SWEA 달팽이 숫자(D2), 날짜 계산기(D2), 간단한 압축 풀기(D2), 탈주범 검거(모의 SW 역량 테스트)
    10.21 SWEA 숫자 만들기(모의 SW 역량 테스트)
    10.20 SWEA 어디에 단어가 들어갈 수 있을까(D2), 시각 덧셈(D2), 스도쿠 검증(D2), 쉬운 거스름돈(D2), 숫자를 정렬하자(D2), 숫자 배열 회전(D2), 두 개의 숫자열(D2)
    10.19 SWEA 패턴 마디의 길이(D2), 파스칼의 삼각형(D2), 파리 퇴치(D2), 초심자의 회문 검사(D2), 지그재그 숫자(D2), 중간 평균값 구하기(D2), 조교의 성적 매기기(D2)
    10.18 SWEA 서랍의 비밀번호(D1), 몫과 나머지 출력하기(D1), 대각선 출력하기(D1), N줄덧셈(D1), 더블더블(D1), 아주 간단한 계산기(D1), 1대1 가위바위보(D1), 간단한 N의 약수(D1), 간단한 369게임(D2), 백만 장자 프로젝트(D2)
    10.17 백준 시험감독🥉
    SWEA 스탬프 찍기(D1), 신문 헤드라인(D1), 알파벳을 숫자로 변환(D1), 연월일 달력(D1), 자릿수 더하기(D1), 중간값 찾기(D1), 최대수 구하기(D1), 큰놈 작은놈 같은놈(D1), 평균값 구하기(D1), 홀수만 더하기(D1)
    10.14 SWEA 보호필름(모의 SW 역량 테스트)
    10.13 백준 테트로미노🥇, 2048(Easy)🥇
    10.12 백준 청소년 상어🥇, 어른상어🥇
    10.11 백준 회전초밥🥇
    SWEA 활주로 건설하기(모의 SW 역량 테스트)
    10.09 백준 트리 순회🥈, 아기 상어🥇, Hashing🥉
    10.07 백준 게리맨더링🥇, 다리 만들기2🥇
    SWEA 키 순서(D4)
    10.06 백준 아기 상어 2🥈, 맥주 마시면서 걸어가기1🥈
    SWEA 최장 증가 부분 수열(D3), 사람 네트워크1(D6)
    10.05 백준 섬의 개수🥈, 달이차오른다, 가자.🥇, 낚시왕🥇
    10.04 백준 연구소🥇, 스도쿠🥇
    SWEA 벽돌 깨기(모의 SW 역량 테스트), 방향전환(D4)
    10.01 백준 곱셈🥈
    09.30 백준 1로 만들기🥈, 파이프 옮기기1🥇, 말이 되고픈 원숭이🥇
    SWEA 보급로(D4)
    09.29 백준 꼬마 정민🥉, RGB 거리🥈
    09.26 백준 A→B🥈
    SWEA 수영장(모의 SW 역량테스트)
    09.24 백준 N과 M(12)🥈
    09.22 백준 N과 M(8)🥈, N과 M(9)🥈
    09.21 백준 N과 M(5)🥈
    09.20 백준 N과 M(2)🥈, N과 M(4)🥈
    09.19 백준 조합🥈, 카드 정렬하기🥇
    09.17 백준 치즈🥇
    09.15 백준 치즈🥇
    09.13 백준 이중 우선순위 큐🥇
    09.08 백준 경로 찾기🥈
    09.06 백준 숨바꼭질 4🥇
    09.05 백준 종이의 개수🥈
    09.02 백준 계단 오르기🥈
    09.01 백준 비밀번호 찾기🥈
    08.31 백준 색종이 만들기🥈, 좌표 압축🥈
    08.30 백준 2xn 타일링🥈
    08.29 백준 바이러스🥈
    08.26 백준 녹색 옷 입은 애가 젤다지?🥇, 미세먼지 안녕!🥇, 최단 경로🥇
    SWEA 특이한 자석(모의 SW 역량테스트)
    08.25 백준 외판원 순회2🥈, 최소 스패닝 트리🥇
    08.24 백준 최소 스패닝 트리🥇, 적록색약🥇, 아기상어🥇, 토마토🥇, 탈출🥇
    08.23 백준 듣보잡🥈, 최대 힙🥈, 최소 힙🥈, 제로🥈, 좌표 정렬하기 2🥈, 나는야 포켓몬 마스터 이다솜🥈, 집합🥈, ABCDE🥇
    SWEA 서로소 집합(D4), 최소 스패닝 트리(D4), 창용 마을 무리의 개수(D4)
    08.22 백준 창영이의 일기장🥉, 일우는 야바위꾼🥉, 영화감독 숌🥈, 팩토리얼 0의 개수🥈, 암호 만들기🥇
    SWEA Contact(D4)
    08.19 백준 DFS와 BFS🥈, 숨바꼭질🥈, 캐슬 디펜스🥇
    SWEA 최적 경로(D5), 준환이의 양팔저울(D5)
    08.18 백준 회의실 배정🥈, 알파벳🥇, 빵집🥇
    08.17 백준 잃어버린 괄호🥈, 쿼드트리🥈
    SWEA 무선 충전(모의 SW 역량테스트)
    정올 냉장고
    08.16 백준 설탕 배달🥈, Z🥈
    08.12 백준 체스판 다시 칠하기🥈, 절댓값 힙🥈, 치킨 배달🥇
    SWEA 요리사(모의 SW 역량테스트)
    08.11 백준 백설공주와 일곱 난쟁이🥉, 수 정렬하기3🥉, 도영이가 만든 맛있는 음식🥈
    SWEA 햄버거 다이어트(D3)
    08.10 백준 다리놓기🥈, 요세푸스 문제 0🥈, 덱🥈, 숫자 카드2🥈, 배열 돌리기1🥈, 배열 돌리기3🥈, 배열 돌리기4🥇
    08.09 백준 색종이🥉
    SWEA 사칙연산 유효성 검사(D4), 정사각형 방(D4), 규영이와 인영이의 카드게임(D3)
    08.08 백준 요세푸스 문제🥈
    SWEA 암호문1(D3), 한빈이와 Spot Mart(D3)
    08.06 백준 DNA 비밀번호🥈, 신기한 소수🥇
    08.05 백준 탑🥇
    08.04 백준 카드2🥈
    SWEA 괄호 짝짓기(D4), 암호생성기(D3)
    08.03 백준 이항계수1🥉, 구간합 구하기 5🥈, 구간합 구하기 4🥈, 나이순 정렬🥈
    SWEA 상호의 배틀필드(D3), 파리 퇴치(D2)
    08.02 백준 팰린드롬 수🥉, 직각삼각형🥉, 스위치 켜고 끄기🥈, 수 찾기🥈
    SWEA Flatten(D3), 농작물 수확하기(D3), Ladder(D4), 달팽이 숫자(D2)
    08.01 백준 좌표 정렬하기🥈, 재귀함수가 뭔가요🥈, 스위치 켜고 끄기🥈
    SWEA 원재의 메모리 복구하기(D3)
    07.31 백준 단어 정렬🥈
    07.28 백준 최대공약수와 최소공배수🥉, 덩치🥈
    07.25 백준 분해합🥉, 부녀회장이 될테야🥉
    07.24 백준 직사각형에서 탈출🥉
    07.21 백준 ACM 호텔🥉
    07.20 백준 달팽이는 올라가고 싶다🥈
    07.19 백준 벌집🥉, 블랙잭🥉
    07.18 백준 설탕배달🥈
    07.10 SWEA 두개의 숫자열(D2), 어디에 단어가 들어갈 수 있을까(D2), 숫자 배열 회전(D2), 스도쿠 검증(D2)
    06.01 백준 OX퀴즈🥉
    05.31 백준 슷자의 합🥉, 아스키코드🥉, A+B-5🥉, A+B-4🥉, A+B-3🥉, X보다 작은 수🥉, 사칙연산🥉, 최소최대🥉, 알파벳 찾기🥉
    05.30 백준 고양이🥉, 나머지🥉, 음계🥉, 상수🥉, 개🥉
    05.28 백준 플로이드🥇, 집합의 표현🥇
    05.25 백준 최댓값🥉, 숫자의 개수🥉, 알람 시계🥉, 윤년🥉, N 찍기🥉, 기찍 N🥉, 구구단🥉, 문자열 반복🥉
    05.20 백준 별찍기-1🥉, 별찍기-2🥉, 검증수🥉
    05.19 백준 A+B🥉, A-B🥉, A/B🥉, AXB🥉, 단어의 개수🥉, 단어 공부🥉, Hello World🥉, 시험 성적🥉, 평균🥉, 두 수 비교하기🥉, 암호 만들기🥇
    05.17 백준 알파벳🥇
    05.14 백준 베트로랑 공준🥈, 미로 탐색🥈, 단지번호붙이기🥈, 숨바꼭질🥈, RGB거리🥈, 회의실 배정🥈, 토마토🥇
    05.13 백준 피보나치 함수🥈, 유기농 배추🥈, 한수🥈, DFS와 BFS🥈, 그룹 단어 체커🥈, 1로 만들기🥈, 소수 찾기🥈, 소수 구하기🥈, 스택🥈, 괄호🥈, 큐🥈, 셀프 넘버🥈, 연속합🥈, 가장 긴 증가하는 부분 수열🥈,크로아티아 알파벳🥈, 수 정렬하기2🥈, ATM🥈, 123 더하기🥈, 동전 0🥈
    04.29 백준 상어 초등학교🥇, 마법사 사어와 비바라기🥇
    04.28 백준 주사위 굴리기🥇, 주사위 굴리기2🥇
    04.27 백준 2048(Easy)🥇, 뱀🥇, 시험 감독🥉
    04.26 백준 구슬 탈출2🥇


    Visit original content creator repository
    https://github.com/SeoYeonBae/algorithmStudy

  • bazel

    {Fast, Correct} – Choose two

    Build and test software of any size, quickly and reliably.

    • Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.

    • One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.

    • Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.

    • Extensible to your needs: Easily add support for new languages and platforms with Bazel’s familiar extension language. Share and re-use language rules written by the growing Bazel community.

    Getting Started

    Documentation

    Reporting a Vulnerability

    To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.

    Contributing to Bazel

    See CONTRIBUTING.md

    Build status

    Visit original content creator repository https://github.com/fc883388/bazel
  • specks

    Specks logo

    Simple hook based state management for React.

    Getting Started     Actions     Codesandbox


    Features

    • Hook based: Specks has a simple API based on a React hook.
    • 🔥 async actions: Actions can be synchronous and async.
    • 🙅‍♀️ Providerless: Specks does not need a Context Provider.
    • ◽️ Super minimalist: No need to set anything up or learn weird design patterns.
    • 🔻 Tiny: Specks only has 82 lines of code.

    Why

    Well, you might not always need Redux. Redux is very versatile, but it can get a bit too complicated, especially for small projects. Specks aims to be a tiny state management library for smaller projects. It is built for projects, where Redux is too much but React’s built in state management is not enough.

    Getting started

    Installing Specs

    You must also install react for Specks to work.

    # Using npm
    npm install specks
    
    # Using yarn
    yarn add specks

    Basic Store

    import { createStore } from 'specks';
    
    let { useStore } = createStore(({ get, set }) => {
      name: 'unknown',
      setName: (name) => {
        set({ name });
      }
    });
    
    let Component = () => {
      // Get the needed values from the store
      let name = useStore(s => s.name);
      let setName = useStore(s => s.setName);
    
      let onNameChange = (e) => {
        // Call the `setName` action
        setName(e.target.name);
      };
    
      return (
        <div>
          <p>Name: { name }</p>
          <input onChange={ onNameChange } value={ name }>
        </div>
      );
    };

    Usage

    Actions and the Initializer Function

    The initializer function is a function, which contains the initial state and all actions. It gets and object containing two functions (get and set) as its first parameter. The get function accepts no parameters and returns the whole state. The set function accepts a partial state object, which will be used to update the state (using Object.assign).

    Actions are functions which can be used to update the state. In most cases you should use actions instead of updating the state directly. The can have parameters, which you can use to pass additional data, when calling the action.

    let { /* ... */ } = createStore(({ get, set }) => {
      count: 0,
      addOne: () => {
        let currentCount = get().count;
        set({ count: currentCount + 1 });
      },
      add: (num) => {
        let currentCount = get().count;
        set({ count: currentCount + num });
      }
    });

    Async Actions

    Actions can be async or synchronous, Specks does not care.

    let { /* ... */ } = createStore(({ get, set }) => {
      // ...
      actionName: async () => {
        let data = await fetchDataFromServer();
    
        set({ data });
      }
    });

    Using Slices

    If you use the useStore hook, the first Argument is a slicing function. It gets passed the whole state and returns any value. Specks will execute this function every time the state changes. If the function’s return value changes, the components using it will be rerendered. If the return value does not change, nothing will be rerendered.

    The slices return value can be anything.

    let Component = () => {
      // Getting a value from the store object
      let value = useStore(s => s.value);
    
      // Adding a 1 to a value from the store
      let count = useStore(s => s.count + 1);
    
      // Checking if something is set
      let valueExists = useStore(s => s.value !== undefined);
    
      // Use a store value in a string
      let greeting = useStore(s => `Hello ${ s.name }`);
    
      // ...
    };

    Usage Without React

    In some cases you might want to get or set the state outside of a React component. You can use the store object which is returned by createStore to do that. The store object has two functions: getState and setState. They behave similar the get and set in the initializer function.

    let { store } = createStore(({ get, set }) => {
      name: 'unknown',
      setName: (name) => {
        set({ name });
      }
    });
    
    let name = store.getState();
    store.setState({ name: 'John' });

    API

    createStore(initializer): { store, useStore }

    The createStore function is exported from Specks and can be used to create a new store instance.

    initializer

    The initializer is a function which is used to set up the initial state and all actions. It has one parameter, which is an object containing a get and a set function used to manipulate the state.

    let { /* ... */ } = createStore(({ get, set }) => {
      count: 0,
      add: (num) => {
        let currentCount = get().count;
        set({ count: currentCount + num });
      }
    });
    get()

    get returns the whole state.

    set(partial)

    set accepts a partial state object which is used to update state using Object.assign. Partial means that it only includes the values which should be changed, all others will remain untouched.

    store

    store can be used to manipulate the state outside of React. It has two values: getState and setState.

    getState()

    getState returns the whole state.

    setState(partial)

    setState accepts a partial state object which is used to update state using Object.assign.

    useStore(slice)

    useStore is a React hook, which can be used to access the state and the actions in a React component.

    slice

    slice is a function which is used to pick a specific value out of the state (eg. a value or an action). The component will only rerender if the slice’s return value changes. The slice function can return any value.

    License

    MIT © Tobias Herber

    Visit original content creator repository https://github.com/herber-legacy-4-varld-1/specks
  • vim-project-lint

    Vim project lint

    Project level lint status right in your favorite file explorer.

    Tested on:

    • Neovim 0.3.1+ – Linux
    • Vim 8.0+ – Linux

    File explorers

    NERDTree

    project-lint-nerdtree

    defx.nvim

    project-lint-defx

    vimfiler.vim

    project-lint-vimfiler

    Requirements

    • Vim or Neovim with “jobs” feature
    • One of these file explorers:
    1. NERDTree
    2. Defx.nvim
    3. Vimfiler.vim

    Optional, but highly recommended for best performance:

    Installation

    Choose your favorite package manager. If you don’t have one, i recommend vim-packager

    function! PackagerInit()
    packadd vim-packager
    call packager#add('kristijanhusak/vim-packager', {'type': 'opt'})
    call packager#add('kristijanhusak/vim-project-lint')
    
    "File explorers. Choose your favorite.
    "NERDTree
    call packager#add('scrooloose/nerdtree')
    
    "Defx.nvim
    call packager#add('Shougo/defx.nvim')
    
    "Vimfiler
    call packager#add('Shougo/unite.vim')
    call packager#add('Shougo/vimfiler.vim')
    endfunction
    command! PackagerInstall call PackagerInit() | call packager#install()
    
    "NERDTree
    nnoremap <Leader>n :NERDTree<CR>
    
    "vimfiler.vim
    let g:vimfiler_explorer_columns = 'project_lint:type'
    nnoremap <Leader>n :VimfilerExplorer
    
    "defx.nvim
    nnoremap <Leader>n :Defx -columns=project_lint:mark:filename:type<CR>

    Configuration

    This is the default configuration:

    "Styling
    let g:project_lint#error_icon = ''
    let g:project_lint#warning_icon = ''
    let g:project_lint#error_icon_color = 'guifg=#fb4934 ctermfg=167'
    let g:project_lint#warning_icon_color = 'ctermfg=214 guifg=#fabd2f'
    
    "Linter settings
    "example:
    " let g:project_lint#enabled_linters = {'javascript': ['eslint'], 'python': ['mypy']}
    " If there's no setting provided for filetype, all available linters are used.
    " If provided an empty array fora filetype, no linting is done for it.
    let g:project_lint#enabled_linters = {}
    
    "example:
    "let g:project_lint#linter_args = {'mypy': '--ignore-missing-imports'}
    let g:project_lint#linter_args = {}
    
    "Folder settings
    "Lint status is cached for each project in this folder.
    let g:project_lint#cache_dir = '~/.cache/vim-project-lint'
    
    " When this is left empty, all folders from $HOME and above are ignored and not linted:
    " example of empty value: `['/home/kristijan', '/home', "https://github.com/"]`
    " To allow linting these folders (not recommended), set this value to `v:false`
    " Or use your own list of folders. When non-empty value is provided, above defaults are not added.
    let g:project_lint#ignored_folders = []
    
    "Other
    " Echo linting progress in command line. Another way to get the progress info is to use statusline.
    " example:
    " set statusline+=project_lint#statusline()
    let g:project_lint#echo_progress = v:true
    
    " Prints all calls to linter commands and their responses. Mostly useful for development.
    let g:project_lint#debug = v:false

    Available linters

    Language Linters
    Python mypy, flake8
    Javascript eslint
    Go golint, go vet, revive
    Css, Sass, Scss stylelint
    Lua luac, luacheck
    php php -l
    Ruby ruby, rubocop
    Rust rustc
    Vim vint
    Typescript eslint, tslint

    LICENSE

    MIT

    Visit original content creator repository https://github.com/kristijanhusak/vim-project-lint