Author: klvps638czu5

  • hiss

    pypi wheel travis License: Apache-2.0 Join the chat at https://gitter.im/KennethanCeyer/PIGNOSE

    What is the hiss?

    hiss is simple cli tool to control the database schema. If you care a stable enterprise service, You need to know hiss cli.

    If you designed the schema of development environment database, and you want to move it to a production server.

    It would be difficult and unstable. hiss can help to migrate for deployment and also help to ETL for another database engine.

    Installation

    hiss can be installed pypi.

    $ pip install hiss-cli

    Features (Plan)

    • Supporting common databases (MySQL, MSSQL, PostgreSQL, MariaDB, Oracle)
    • Controlling revision history of changes the schema.
    • Commit, Rollback, Push, Reset, Tag, List, Show (The simple command designs based on Git.
    • ETL to another database and analyze (To another common databases or distribute engines: Athena, Presto, Impala, Druid, Hadoop system, or JSON, XML, CSV)

    Design (Plan)

    $ hiss init
    $ hiss remote add origin database.endpoint.com:3306
    
    > connecting... done.
    > database `MySQL`, v5.7.11
    > Type username: {username}
    > Type password: {password}
    
    $ hiss show databases
    > couting databses: 32.
    > databse_1_schema
    > databse_2_schema
    > databse_3_schema
    > more...
    
    $ hiss checkout database_1_schema
    > switched to database `database_1_schema`.
    
    $ hiss show tables
    > counting tables: 160.
    > information_schema
    > table_1_sample
    > table_2_sample
    > table_3_sample
    
    $ hiss set tables table_1_sample
    > now your current table is `table_1_sample`.
    
    $ hiss add column new_column int(64) pk auto_increment default 0 not null -m 'column comment'
    > add column `new_column`, done.
    
    $ hiss status
    > counting changes: 1, done.
    > add column 'new_column' int(64) primary auto_increment default 0 not null
    > : column comment
    > end
    
    $ hiss commit -m 'add new column for testing'.
    > 1 changes are committed, 1 add(+), 0 remove(-), 0 modified(=).
    
    $ hiss reset HEAD^ --hard
    > reset... done.
    > : first commit message.
    
    $ hiss tag -a v1.0 -m 'marking for first commition.'
    > done.

    Notice

    This repository is still progress under development.

    If you want to use the demo version, Please send a message via gitter (Check the above badge).

    Thank you.

    TODO

    • [] Continous Integration & Continous Deployment
    • [] Add UnitTest
    • [] Add commands: init, show, checkout
    • [] Integration with MySQL
    • [] Branding: LOGO
    Visit original content creator repository https://github.com/KennethanCeyer/hiss
  • PyPaperBot

    Donate

    NEWS: PyPaperBot development is back on track!

    Join the Telegram channel to stay updated, report bugs, or request custom data mining scripts.


    PyPaperBot

    PyPaperBot is a Python tool for downloading scientific papers and bibtex using Google Scholar, Crossref, SciHub, and SciDB. The tool tries to download papers from different sources such as PDF provided by Scholar, Scholar related links, and Scihub. PyPaperbot is also able to download the bibtex of each paper.

    Features

    • Download papers given a query
    • Download papers given paper’s DOIs
    • Download papers given a Google Scholar link
    • Generate Bibtex of the downloaded paper
    • Filter downloaded paper by year, journal and citations number

    Installation

    For normal Users

    Use pip to install from pypi:

    pip install PyPaperBot

    If on windows you get an error saying error: Microsoft Visual C++ 14.0 is required.. try to install Microsoft C++ Build Tools or Visual Studio

    For Termux users

    Since numpy cannot be directly installed….

    pkg install wget
    wget https://its-pointless.github.io/setup-pointless-repo.sh
    pkg install numpy
    export CFLAGS="-Wno-deprecated-declarations -Wno-unreachable-code"
    pip install pandas
    

    and

    pip install PyPaperbot
    

    How to use

    PyPaperBot arguments:

    Arguments Description Type
    –query Query to make on Google Scholar or Google Scholar page link string
    –skip-words List of comma separated words i.e. “word1,word2 word3,word4”. Articles containing any of this word in the title or google scholar summary will be ignored string
    –cites Paper ID (from scholar address bar when you search cites) if you want get only citations of that paper string
    –doi DOI of the paper to download (this option uses only SciHub to download) string
    –doi-file File .txt containing the list of paper’s DOIs to download string
    –scholar-pages Number or range of Google Scholar pages to inspect. Each page has a maximum of 10 papers string
    –dwn-dir Directory path in which to save the result string
    –min-year Minimal publication year of the paper to download int
    –max-dwn-year Maximum number of papers to download sorted by year int
    –max-dwn-cites Maximum number of papers to download sorted by number of citations int
    –journal-filter CSV file path of the journal filter (More info on github) string
    –restrict 0:Download only Bibtex – 1:Download only papers PDF int
    –scihub-mirror Mirror for downloading papers from sci-hub. If not set, it is selected automatically string
    –annas-archive-mirror Mirror for downloading papers from Annas Archive (SciDB). If not set, https://annas-archive.se is used string
    –scholar-results Number of scholar results to bedownloaded when –scholar-pages=1 int
    –proxy Proxies to be used. Please specify the protocol to be used. string
    –single-proxy Use a single proxy. Recommended if using –proxy gives errors. string
    –selenium-chrome-version First three digits of the chrome version installed on your machine. If provided, selenium will be used for scholar search. It helps avoid bot detection but chrome must be installed. int
    –use-doi-as-filename If provided, files are saved using the unique DOI as the filename rather than the default paper title bool
    -h Shows the help

    Note

    You can use only one of the arguments in the following groups

    • –query, –doi-file, and –doi
    • –max-dwn-year and and max-dwn-cites

    One of the arguments –scholar-pages, –query , and –file is mandatory The arguments –scholar-pages is mandatory when using *–query * The argument –dwn-dir is mandatory

    The argument –journal-filter require the path of a CSV containing a list of journal name paired with a boolean which indicates whether or not to consider that journal (0: don’t consider /1: consider) Example

    The argument –doi-file require the path of a txt file containing the list of paper’s DOIs to download organized with one DOI per line Example

    Use the –proxy argument at the end of all other arguments and specify the protocol to be used. See the examples to understand how to use the option.

    SciHub access

    If access to SciHub is blocked in your country, consider using a free VPN service like ProtonVPN Also, you can use proxy option above.

    Example

    Download a maximum of 30 papers from the first 3 pages given a query and starting from 2018 using the mirror https://sci-hub.do:

    python -m PyPaperBot --query="Machine learning" --scholar-pages=3  --min-year=2018 --dwn-dir="C:\User\example\papers" --scihub-mirror="https://sci-hub.do"

    Download papers from pages 4 to 7 (7th included) given a query and skip words:

    python -m PyPaperBot --query="Machine learning" --scholar-pages=4-7 --dwn-dir="C:\User\example\papers" --skip-words="ai,decision tree,bot"

    Download a paper given the DOI:

    python -m PyPaperBot --doi="10.0086/s41037-711-0132-1" --dwn-dir="C:\User\example\papers" -use-doi-as-filename`

    Download papers given a file containing the DOIs:

    python -m PyPaperBot --doi-file="C:\User\example\papers\file.txt" --dwn-dir="C:\User\example\papers"`

    If it doesn’t work, try to use py instead of python i.e.

    py -m PyPaperBot --doi="10.0086/s41037-711-0132-1" --dwn-dir="C:\User\example\papers"`

    Search papers that cite another (find ID in scholar address bar when you search citations):

    python -m PyPaperBot --cites=3120460092236365926

    Using proxy

    python -m PyPaperBot --query=rheumatoid+arthritis --scholar-pages=1 --scholar-results=7 --dwn-dir=/download --proxy="http://1.1.1.1::8080,https://8.8.8.8::8080"
    
    python -m PyPaperBot --query=rheumatoid+arthritis --scholar-pages=1 --scholar-results=7 --dwn-dir=/download -single-proxy=http://1.1.1.1::8080
    

    In termux, you can directly use PyPaperBot followed by arguments…

    Contributions

    Feel free to contribute to this project by proposing any change, fix, and enhancement on the dev branch

    To do

    • Tests
    • Code documentation
    • General improvements

    Disclaimer

    This application is for educational purposes only. I do not take responsibility for what you choose to do with this application.

    Donation

    If you like this project, you can give me a cup of coffee 🙂

    paypal

    Visit original content creator repository https://github.com/ferru97/PyPaperBot
  • ShortLink

    ShortLink

    GitHub release AUR Donate

    ShortLink is a simple URL Shortening script powered purely by PHP. Check ShortLink: https://azetrix.xyz/

    ~ REINVENTING THE WHEEL ~

    Update: We currently have no funding to support the development of this application. We are suspending its development until further notice. This might take weeks in duration. (6/9/2017)

    Update: The development of this project is now active. We have reconstructed everything to comply with the common modern-PHP coding practices. (11/23/2018)

    Features

    • It can create up to 15.625 billion unique URLs in 6 or less characters.
    • It has the ability to create custom links up to 20 Characters.
    • It has a beautiful modern UI. Powered by Bulma CSS.
    • Domain blacklist with shell wildcard support.
    • ShortLink blacklist with shell wildcard support.
    • Predefined blacklist for inappropriate domains and custom ShortLinks.
    • Google reCAPTCHA integration is now built-in.
    • Supports link preview and force redirection.

    Prerequisites

    • MySQL Database
    • PHP
    • Apache Server

    Installation

    1. Upload all files to your web root.
    2. Rename sample.htaccess to .htaccess if you’re using Apache Server.
    3. Create new MySQL Database.
    4. Set your MySQL credentials at inc/vars.php.
    5. Set your web root in SHORTLINK_PREFIX at inc/vars.php.
    6. Set your contact email in CONTACT_EMAIL at inc/vars.php.
    7. Optionally, you can modify the $kw_blacklist (keyword blackist) and $dom_blacklist (domain blacklist) at inc/vars.php to suit your needs.
    Visit original content creator repository https://github.com/azetrix/ShortLink
  • HP-EliteBook-840-G5-Hackintosh

    macOS on HP EliteBook 840 G5

    OpenCore config for Hackintosh HP EliteBook 840 G5

    Table of Contents

    Original Hardware 💻

    Type Spec Status
    Model Name HP Elitebook 840 G5
    CPU Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (max 4.00Ghz) Kaby Lake R
    RAM 32 GB 2400 MHz DDR4
    Internal Graphics Card Intel® UHD Graphics 620
    Wi-Fi Intel 8265
    Ethernet Intel I219
    Audio Conexant CX8200

    macOS Update History

    • ✅ macOS Ventura 13.0
    • ✅ macOS Monterey 12.6
    • ✅ macOS Monterey 12.3
    • ✅ macOS Monterey 12.0.1
    • ✅ macOS Big Sur 11.6.1
    • ✅ macOS Big Sur 11.0.1

    What’s working 💻

    Type Status
    Turbo boost and CPU frequency stage
    Intel HD Graphics
    Brightness control
    HDMI
    Audio
    Ethernet
    Wi-Fi and Bluetooth
    USB 3.0 (with Port Map)
    Touchpad (14 gestures are working)
    Battery status
    Shutdown / Reboot
    Fn shortcut keys

    What’s not working 💻

    Type Status
    Camera
    S3 Sleep / Wake
    S4 Hibernation / Wake

    What’s you have to do 💻

    Type Info Status
    SMBIOS Settings With [GenSMBIOS] you should definitely set your SMBIOS settings and ROM value for iCloud and Apple services. ROM value is your ethernet MAC address. Be sure your ethernet is en0 in Hackintool. ⚠️

    Kexts Used

    Name Info
    Lilu [Global] An open source kernel extension bringing a platform for arbitrary kext, library, and program patching throughout the system for macOS.
    VirtualSMC [SMC] Advanced Apple SMC emulator in the kernel. Requires Lilu for full functioning.
    WhateverGreen [Graphics] Various patches necessary for certain ATI/AMD/Intel/Nvidia GPUs.
    AppleALC [Audio] An open source kernel extension enabling native macOS HD audio for not officially supported codecs without any filesystem modifications.
    USBPorts [USB]Kext to inject mapped USB Ports. (via Hackintool)
    VoodooI2C [Touchpad] VoodooI2C is a project consisting of macOS kernel extensions that add support for I2C bus devices.
    VoodooPS2Controller [PS2] Contains updated Voodoo PS/2 Controller, improved Keyboard & Synaptics TouchPad.
    SMCBatteryManager [Battery] a member of VirtualSMC that parses battery info.
    SMCLightSensor [Sensor] a member of VirtualSMC that activate light sensor.
    SMCProcessor [Processor] a member of VirtualSMC that provides power info of processor temperature.
    ECEnabler [Battery] Allows reading Embedded Controller fields over 1 byte long, vastly reducing the amount of ACPI modification needed (if any) for working battery status.
    IntelMausi [Ethernet] Intel onboard LAN driver for macOS.
    AirportItlwm [Wi-Fi] An Intel Wi-Fi Adapter Kernel Extension for macOS.
    IntelBluetoothFirmware [Intel Bluetooth] Kernel Extension that uploads Intel Wireless Bluetooth Firmware to provide native Bluetooth in macOS.
    BlueToolFixup [Bluetooth] Injecting bluetooth firmware on Monterey+.
    CPUFriend [Processor] A Lilu plug-in for dynamic power management data injection.
    CPUFriendDataProvider [Processor] A CPUFriend plug-in for CPU power management.
    NVMeFix [SSD] NVMeFix is a set of patches for the Apple NVMe storage driver, IONVMeFamily.
    HibernationFixup [Hibernate] An open source kernel extension providing a sync between RTC variables and NVRAM.

    SSDTs Used

    Name Info Status
    SSDT-PLUG.aml Allow the kernel’s XCPM(XNU’s CPU Power Management) to manage CPU’s power management. [Functional]
    SSDT-EC-USBX.aml Adds a fake Embedded Controller (SSDT-EC) and enables USB Power Management (SSDT-EC-USBX). [Functional]
    SSDT-SBUS-MCHC.aml Fixes System Management Bus and Memory Controller in macOS. [Functional]
    SSDT-PNLF.aml Adds Backlight Control for Laptop Screens. [Functional]
    SSDT-CPD0.aml Enables GPIO device. [Functional]
    SSDT-BATT.aml Fixes the battery status indicator. [Functional]
    SSDT-SET-STAS.aml ACPI patch for newer BIOS versions. [Functional]
    SSDT-ALS0 Adds a fake Ambient Light Sensor (SSDT-ALS0) or enables an existing one in macOS (SSDT-ALSD). [Functional]
    SSDT-TB3.aml Thunderbolt 3 driver assignment. [Functional]

    Credits

    • Dortania for developing OpenCore.
    • Apple for macOS.
    • Acidanthera for most of the kexts.
    • RehabMan for battery patches.
    • Sniki for USB kext.
    • And anyone else that helped to develop and improve hackintoshing.

    Donate – Bağış

    Visit original content creator repository https://github.com/yusufklncc/HP-EliteBook-840-G5-Hackintosh
  • react-flip-toolkit

    react-flip-toolkit animated logo

    Minified & Gzipped size MIT license npm version

    Comparison with other React FLIP libraries

    Feature react-flip-move react-overdrive react-flip-toolkit
    Animate position
    Animate scale
    Animate opacity
    Animate parent’s size without warping children
    Use real FLIP instead of cloning & crossfading
    Use springs for animations
    Support spring-based stagger effects
    Usable with frameworks other than React

    Quick start

    npm install react-flip-toolkit or yarn add react-flip-toolkit

    1. Wrap all animated children with a single Flipper component that has a flipKey prop that changes every time animations should happen.

    2. Wrap elements that should be animated with Flipped components that have a flipId prop matching them across renders.

    Table of Contents

    Forkable Examples

    Simple Example: An Expanding Div

    animated square

    Fork this example on Code Sandbox

    import React, { useState } from 'react'
    import { Flipper, Flipped } from 'react-flip-toolkit'
    
    const AnimatedSquare = () => {
      const [fullScreen, setFullScreen] = useState(false)
      const toggleFullScreen = () => setFullScreen(prevState => !prevState)
    
      return (
        <Flipper flipKey={fullScreen}>
          <Flipped flipId="square">
            <div
              className={fullScreen ? 'full-screen-square' : 'square'}
              onClick={toggleFullScreen}
            />
          </Flipped>
        </Flipper>
      )
    }

    Simple Example: Two Divs

    2 animated squares

    Fork this example on Code Sandbox

    import React, { useState } from 'react'
    import { Flipper, Flipped } from 'react-flip-toolkit'
    
    const Square = ({ toggleFullScreen }) => (
      <Flipped flipId="square">
        <div className="square" onClick={toggleFullScreen} />
      </Flipped>
    )
    
    const FullScreenSquare = ({ toggleFullScreen }) => (
      <Flipped flipId="square">
        <div className="full-screen-square" onClick={toggleFullScreen} />
      </Flipped>
    )
    
    const AnimatedSquare = () => {
      const [fullScreen, setFullScreen] = useState(false)
      const toggleFullScreen = () => setFullScreen(prevState => !prevState)
    
      return (
        <Flipper flipKey={fullScreen}>
          {fullScreen ? (
            <FullScreenSquare toggleFullScreen={toggleFullScreen} />
          ) : (
            <Square toggleFullScreen={toggleFullScreen} />
          )}
        </Flipper>
      )
    }

    Simple Example: List Shuffle

    shuffling a list

    Fork this example on Code Sandbox

    import React, { useState } from 'react'
    import { Flipper, Flipped } from 'react-flip-toolkit'
    import shuffle from 'lodash.shuffle'
    
    const ListShuffler = () => {
      const [data, setData] = useState([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
      const shuffleList = () => setData(shuffle(data))
    
      return (
        <Flipper flipKey={data.join('')}>
          <button onClick={shuffleList}> shuffle</button>
          <ul className="list">
            {data.map(d => (
              <Flipped key={d} flipId={d}>
                <li>{d}</li>
              </Flipped>
            ))}
          </ul>
        </Flipper>
      )
    }

    List Transitions

    Add some interest to a dynamic list of cards by animating changes to cards’ sizes and positions.

    animated list

    Fork this example on Code Sandbox

    Stagger Effects

    The react-flip-toolkit library offers spring-driven stagger configurations so that you can achieve complex sequenced effects.

    For the most basic stagger effect, you can simply add a stagger boolean prop to your Flipped element:

    <Flipped flipId={`element-${i}`} stagger>
      <AnimatedListItem/>
    </Flipped>
    animation for the selected state of a list item

    Fork this example on Code Sandbox

    Spring Customizations

    react-flip-toolkit uses springs for animations. To customize the spring, you can pass in a preset name:

    // spring preset can be one of: "stiff", "noWobble", "gentle", "veryGentle", or "wobbly"
    <Flipper flipKey='foo' spring='wobbly'>
      {/* Flipped components go here...*/}
    </Flipper>

    or a custom spring config:

    <Flipper flipKey='foo' spring={{ stiffness: 280, damping: 22 }} >
      {/* Flipped components go here...*/}
    </Flipper>

    View all spring options in the interactive explorer

    Nested Scale Transforms

    stripe menu

    Interesting animations often involve scale transforms in addition to simple translate transforms. The problem with scale animations has to do with children — if you scale a div up 2x, you will warp any children it has by scaling them up too, creating a weird-looking animation. That’s why this library allows you to wrap the child with a Flipped component that has an inverseFlipId to counteract the transforms of the parent:

    <Flipped flipId={id}>
      <div>
        <Flipped inverseFlipId={id} scale>
          <div>some text that will not be warped</div>
        </Flipped>
      </div>
    </Flipped>

    By default, both the scale and the translation transforms of the parent will be counteracted (this allows children components to make their own FLIP animations without being affected by the parent). But for many use cases, you’ll want to additionally specify the scale prop to limit the adjustment to the scale and allow the positioning to move with the parent.

    Note: the DOM element with the inverse transform should lie flush against its parent container for the most seamless animation.

    That means any layout styles — padding, flexbox, etc—should be applied to the inverted container (the element wrapped with a Flipped component with an inverseFlipId) rather than the parent Flipped container.

    Route-based Animations With React Router

    React-flip-toolkit with React-Router

    Fork Github repo

    react-flip-toolkit works great with client-side routers to provide route-driven transitions:

    <Route
      render={({ location, search }) => {
        return (
          <Flipper
            flipKey={`${location.pathname}-${location.search}`}
          >
          {/* Child routes that contain Flipped components go here...*/}
          </Flipper>
        )
      }}
    />

    More examples

    The Components

    Flipper

    The parent wrapper component that contains all the elements to be animated. You’ll often need only one of these per page, but sometimes it will be more convenient to have multiple Flipper regions of your page concerned with different transitions.

    <Flipper flipKey={someKeyThatChanges}>{/* children */}</Flipper>

    Basic Props

    prop default type details
    flipKey (required) string, number, bool Changing this tells react-flip-toolkit to transition child elements wrapped in Flipped components.
    children (required) node One or more element children
    spring noWobble string or object Provide a string referencing one of the spring presets — noWobble (default), veryGentle, gentle, wobbly, or stiff, OR provide an object with stiffness and damping parameters. Explore the spring setting options here. The prop provided here will be the spring default that can be overrided on a per-element basis on the Flipped component.
    applyTransformOrigin true bool Whether or not react-flip-toolkit should apply a transform-origin of “0 0” to animating children (this is generally, but not always, desirable for FLIP animations)
    element div string If you’d like the wrapper element created by the Flipped container to be something other than a div, you can specify that here.
    className string A class applied to the wrapper element, helpful for styling.
    staggerConfig object Provide configuration for staggered Flipped children. The config object might look something like the code snippet below:
    staggerConfig={{
      // the "default" config will apply to staggered elements without explicit keys
          default: {
            // default direction is forwards
            reverse: true,
            // default is .1, 0 < n < 1
            speed: .5
          },
      // this will apply to Flipped elements with the prop stagger='namedStagger'
        namedStagger : { speed: .2 }
      }}

    Advanced Props

    prop default type details
    decisionData any Sometimes, you’ll want the animated children of Flipper to behave differently depending on the state transition — maybe only certain Flipped elements should animate in response to a particular change. By providing the decisionData prop to the Flipper component, you’ll make that data available to the shouldFlip and shouldInvert methods of each child Flipped component, so they can decided for themselves whether to animate or not.
    debug false boolean This experimental prop will pause your animation right at the initial application of FLIP-ped styles. That will allow you to inspect the state of the animation at the very beginning, when it should look similar or identical to the UI before the animation began.
    portalKey string In general, the Flipper component will only apply transitions to its descendents. This allows multiple Flipper elements to coexist on the same page, but it will prevent animations from working if you use portals. You can provide a unique portalKey prop to Flipper to tell it to scope element selections to the entire document, not just to its children, so that elements in portals can be transitioned.
    onStart function This callback prop will be called before any of the individual FLIP animations have started. It receives as arguments the HTMLElement of the Flipper and the decisionData object described elsewhere.
    onComplete function This callback prop will be called when all individual FLIP animations have completed. Its single argument is a list of flipIds for the Flipped components that were activated during the animation. If an animation is interrupted, onComplete will be still called right before the in-progress animation is terminated.
    handleEnterUpdateDelete function By default, react-flip-toolkit finishes animating out exiting elements before animating in new elements, with updating elements transforming immediately. You might want to have more control over the sequence of transitions — say, if you wanted to hide elements, pause, update elements, pause again, and finally animate in new elements. Or you might want transitions to happen simultaneously. If so, provide the function handleEnterUpdateDelete as a prop. The best way to understand how this works is to check out this interactive example. handleEnterUpdateDelete receives the following arguments every time a transition occurs:
    handleEnterUpdateDelete({
      // this func applies an opacity of 0 to entering elements so
      // they can be faded in - it should be called immediately
      hideEnteringElements,
      // calls `onAppear` for all entering elements
      animateEnteringElements,
      //calls `onExit` for all exiting elements
      // returns a promise that resolves when all elements have exited
      animateExitingElements,
      // the main event: `FLIP` animations for updating elements
      // this also returns a promise that resolves when
      // animations have completed
      animateFlippedElements
    })

    Flipped

    Wraps an element that should be animated.

    E.g. in one component you can have

    <Flipped flipId="coolDiv">
      <div className="small" />
    </Flipped>

    and in another component somewhere else you can have

    <Flipped flipId="coolDiv">
      <div className="big" />
    </Flipped>

    and they will be tweened by react-flip-toolkit.

    The Flipped component produces no markup, it simply passes some props down to its wrapped child.

    Wrapping a React Component

    If you want to wrap a React component rather than a JSX element like a div, you can provide a render prop and then apply the flippedProps directly to the wrapped element in your component:

    <Flipped>
      {flippedProps => <MyCoolComponent flippedProps={flippedProps} />}
    </Flipped>
    
    const MyCoolComponent = ({ flippedProps }) => <div {...flippedProps} />

    You can also simply provide a regular React component as long as that component spreads unrecognized props directly onto the wrapped element (this technique works well for wrapping styled components):

    <Flipped>
      <MyCoolComponent />
    </Flipped>
    
    const MyCoolComponent = ({ knownProp, ...rest }) => <div {...rest} />

    Basic props

    prop default type details
    children (required) node or function Wrap a single element, React component, or render prop child with the Flipped component
    flipId (required unless inverseFlipId is provided) string Use this to tell react-flip-toolkit how elements should be matched across renders so they can be animated.
    inverseFlipId string Refer to the id of the parent Flipped container whose transform you want to cancel out. If this prop is provided, the Flipped component will become a limited version of itself that is only responsible for cancelling out its parent transform. It will read from any provided transform props and will ignore all other props (besides inverseFlipId.) Read more about canceling out parent transforms here.
    transformOrigin "0 0" string This is a convenience method to apply the proper CSS transform-origin to the element being FLIP-ped. This will override react-flip-toolkit‘s default application of transform-origin: 0 0; if it is provided as a prop.
    spring noWobble string or object Provide a string referencing one of the spring presets — noWobble (default), veryGentle, gentle, wobbly, or stiff, OR provide an object with stiffness and damping parameters. Explore the spring setting options here.
    stagger false boolean or string Provide a natural, spring-based staggering effect in which the spring easing of each item is pinned to the previous one’s movement. Provide true to stagger the element with all other staggered elements. If you want to get more granular, you can provide a string key and the element will be staggered with other elements with the same key.
    delayUntil false string (flipId) Delay an animation by providing a reference to another Flipped component that it should wait for before animating (the other Flipped component should have a stagger delay as that is the only use case in which this prop is necessary.)

    Callback props

    animation of a sentence transforming into another sentence

    The above animation uses onAppear and onExit callbacks for fade-in and fade-out animations.

    prop arguments details
    onAppear element, index, {previous: decisionData, current: decisionData } Called when the element first appears in the DOM. It is provided a reference to the DOM element being transitioned as the first argument, and the index of the element relative to all appearing elements as the second. Note: If you provide an onAppear prop, the default opacity of the element will be set to 0 to allow you to animate it in without any initial flicker. If you don’t want any opacity animation, just set the element’s opacity to 1 immediately in your onAppear function.
    onStart element, {previous: decisionData, current: decisionData } Called when the FLIP animation for the element starts. It is provided a reference to the DOM element being transitioned as the first argument.
    onStartImmediate element, {previous: decisionData, current: decisionData } Similar to onStart, but guaranteed to run for all FLIP-ped elements on the initial tick of the FLIP animation, before the next frame has rendered, even if the element in question has a stagger delay. It is provided a reference to the DOM element being transitioned as the first argument.
    onSpringUpdate springValue Called with the current spring value (normally between 0 – 1 but might briefly go over or under that range depending on the level of “bounciness” of the spring). Useful if you’d like to tween other, non-FLIP animations in concert with a FLIP transition.
    onComplete element,{previous: decisionData, current: decisionData } Called when the FLIP animation completes. It is provided a reference to the DOM element being transitioned as the first argument. (If transitions are interruped by new ones, onComplete will still be called.)
    onExit element, index, removeElement, {previous: decisionData, current: decisionData } Called when the element is removed from the DOM. It must call the removeElement function when the exit transition has completed.

    Transform props

    By default the FLIP-ped elements’ translate, scale, and opacity properties are all transformed. However, certain effects require more control so if you specify any of these props, only the specified attribute(s) will be tweened:

    prop type details
    translate bool Tween translateX and translateY
    scale bool Tween scaleX and scaleY
    opacity bool

    Advanced props

    Functions to control when FLIP happens

    prop arguments details
    shouldFlip previousDecisionData, currentDecisionData A function provided with the current and previous decisionData props passed down by the Flipper component. Returns a boolean to indicate whether a Flipped component should animate at that particular moment or not.
    shouldInvert previousDecisionData, currentDecisionData A function provided with the current and previous decisionData props passed down by the Flipper component. Returns a boolean indicating whether to apply inverted transforms to all Flipped children that request it via an inverseFlipId.

    Spring

    As a convenience, react-flip-toolkit exports a tiny function to access the same spring system used to create FLIP transitions.

    Fork example on CodeSandbox

    import { spring } from 'react-flip-toolkit'
    
    spring({
      config: "wobbly",
      values: {
        translateY: [-15, 0],
        opacity: [0, 1]
      },
      onUpdate: ({ translateY, opacity }) => {
        el.style.opacity = opacity;
        el.style.transform = `translateY(${translateY}px)`;
      },
      delay: i * 25,
      onComplete: () => console.log('done')
    });
    spring example

    Global configuration functions

    You can programmatically call the following functions if you need to disable (or re-enable) FLIP animations everywhere.

    disableFlip()

    Global switch to disable all animations in all Flipper containers.

    enableFlip()

    Global switch to (re-)enable all animations in all Flipper containers. Animations are enabled by default. Calling this function is needed only if animations were previously disabled with disableFlip().

    isFlipEnabled()

    Returns a boolean indicating whether animations are globally enabled or disabled.

    Library details

    browserstack
    • Tested in latest Chrome, Firefox, Safari, and Edge with Browserstack.
    • Requires React 16+
    • Uses Rematrix for matrix calculations and a simplified fork of Rebound for spring animations

    Troubleshooting

    Problem #1: Nothing is happening

    • Make sure you’re updating the flipKey attribute in the Flipper component whenever an animation should happen.
    • If one of your Flipped components is wrapping another React component rather than a DOM element, use a render prop to get the Flipped props and pass down to the necessary DOM element.
    • Is the element that’s receiving props from Flipped visible in the DOM? react-flip-toolkit attempts to optimize performance by not animating elements that are off-screen or elements that have no width or height.
    • display:inline elements cannot be animated. If you want an inline element to animate, set display:inline-block.
    • Do you have the prefers-reduced-motion setting turned on? As of v7.1.0 that setting will disable all animations.

    Problem #2: Things look weird / animations aren’t behaving

    • Check to make sure all flipIds are unique. At any point, there can only be one element with a specified flipId on the page. If there are multiple Flipped elements on the page with the same id, the animation will break.
    • Make sure you are animating the element you want to animate and not, for instance, a wrapper div. If you are animating an inline element like some text, but have wrapped it in a div, you’re actually animating the div, which might have a much wider width that you’d expect at certain points, which will throw off the animation. Check to see if you need to add an inline-block style to the animated element.
    • Make sure you don’t have any competing CSS transitions on the element in question.
    • If you are animating an image, try giving the image hard-coded dimensions and seeing if that fixes the problem. (If you are relying on the innate dimensions of the image, it might not have been fully rendered by the browser in time for the new image dimensions to be measured.)

    Problem #3: It’s still not working

    • Try out the debug prop. If you still can’t figure out what’s going wrong, you can add the the debug prop directly on your Flipper component to pause transitions at the beginning.
    • If you think something might actually be broken, or are completely stuck, feel free to make an issue.

    Performance

    React-flip-toolkit does a lot of work under the hood to try to maximize the performance of your animations — for instance, off-screen elements won’t be animated, and style updates are batched to prevent layout thrashing. However, if you are building particularly complex animations—ones that involve dozens of elements or large images— there are some additional strategies you can use to ensure performant animations.

    Memoization

    When you trigger a complex FLIP animation with react-flip-toolkit, React could be spending vital milliseconds doing unnecessary reconciliation work before allowing the animation to start. If you notice a slight delay between when the animation is triggered, and when it begins, this is probably the culprit. To short-circuit this possibly unnecessary work, try memoizing your component by using React.memo or PureComponent for your animated elements, and seeing if you can refactor your code to minimize prop updates to animated children when an animation is about to occur.

    will-change:transform

    .box {
      will-change: transform;
    }

    This CSS property tells the browser to anticipate changes to an element. It should be used with caution, because it can increase browser resource usage. If you notice rendering issues in your animation, try seeing if it increases the performance of the animation.

    Visit original content creator repository https://github.com/aholachek/react-flip-toolkit
  • CryptoDataAnalysis

    🚀 Cryptocurrency Data Analysis

    This project fetches live cryptocurrency data for the top 50 cryptocurrencies using the CoinMarketCap API, analyzes it, and updates a live Excel sheet every 5 minutes.

    📌 Features

    • Fetch real-time cryptocurrency data (Name, Symbol, Price, Market Cap, 24h Volume, Price Change %)
    • Analyze the data (Top 5 cryptos by market cap, average price, highest/lowest 24h % change)
    • Live-updating Excel sheet with automatic updates every 5 minutes

    📂 Project Structure

    CryptoDataAnalysis/ 
    ├── README.md 
    ├── requirements.txt 
    ├── config.py  
    ├── main.py # Main script to fetch, analyze, and update Excel  
    ├── docs/
    │ └── analysis_report.docx 
    ├── excel/
    │ └── live_data.xlsx 
    

    🛠️ Setup Instructions

    1️⃣ Install Dependencies

    Ensure you have Python 3.8+ installed, then install the required packages:

    pip install -r requirements.txt
    

    2️⃣ Set Up Your API Key

    You need a CoinMarketCap API Key or an alternative to fetch live data.

    ✅ Using Environment Variables (Recommended)

    Windows (Command Prompt):

    set CMC_API_KEY=your_actual_api_key_here
    

    ✅ Using a .env File (Alternative)

    Create a .env file in the project root:

    CMC_API_KEY=your_actual_api_key_here
    

    The script will automatically load the API key from .env.


    🚀 Running the Project

    To start fetching live cryptocurrency data and updating the Excel sheet:

    python main.py

    This will:
    ✔ Fetch and analyze the top 50 cryptocurrencies
    ✔ Update the excel/live_data.xlsx file
    ✔ Repeat every 5 minutes

    To stop the script, press Ctrl + C.


    📊 Understanding the Output

    🔹 Live-Updated Excel Sheets

    • Sheet 1: Crypto Data → Full dataset of top 50 cryptos
    • Sheet 2: Analysis Summary → Avg price, highest & lowest 24h % change
    • Sheet 3: Top 5 → The top 5 cryptocurrencies by market cap

    🔹 Analysis Report

    • The docs/analysis_report.docx contains a summary of key insights.

    🔒 Security Best Practices

    • DO NOT hardcode your API key in config.py
    • ✅ Use environment variables or .env to store API keys
    • ✅ Add .env to .gitignore to prevent accidental commits

    📝 Contributing

    Feel free to open issues or pull requests if you’d like to improve the project!


    📜 License

    This project is open-source and licensed under the MIT License.


    📬 Contact

    For any questions, feel free to reach out or open a GitHub issue.


    Visit original content creator repository
    https://github.com/saksham-jain177/CryptoDataAnalysis

  • jefBoard

    jefBoard

    example

    Cos’è

    JefBoard è una scheda di sviluppo basata sul microcontroller Attiny2313 della ATMEL. Si presta allo sviluppo di applicazioni di varia natura e integra la predisposizione per la scheda WiFI ESP-01 (Opzionale) e il connettore per la programmazione ISP dell’Attiny2313. Alcune caratteristiche:

    • JefBoard espone tutti i pin dell’Attiny2313 per il loro utilizzo.
    • JefBoard permette la realizzazione di applicazioni con supporto WiFi (il modulo ESP-01 comunica tramite connessione seriale con l’Attiny2313).
    • JefBoard può essere assemblata anche senza l’ESP-01 e relativi componenti di alimentazione se non si necessita di supporto WiFi abbassando ulteriormente il costo.
    • JefBoard è una scheda di piccole dimensioni 6×4 cm.

    Attiny 2313 pinout

    example

    Schema ed elenco componenti

    example

    PCB Layout

    Per reperire la PCB scrivi al mio indirizzo giuseppe.culotta@gmail.com

    example

    pcb

    jefboard_r

    Elenco componenti

    Sigla Valore Tipo Note
    C1 100n Condensatore poliestere
    C2 100u Condensatore elettrolitico
    C4 10u Condensatore elettrolitico (Opzionale – Solo in caso di supporto WIFI)
    C5 22p Condensatore ceramico
    C6 22p Condensatore ceramico
    ESP01 Connettore pin (Opzionale – Solo in caso di supporto WIFI)
    IC1 ATtiny2313/ATtiny2313a AVR
    IC2 LM1117DTX 3.3V (Opzionale – Solo in caso di supporto WIFI)
    JP1 Connettore tipo M100.1 (Opzionale)
    JP2 Connettore tipo M100.1 (Opzionale)
    LED1 LED3MM
    PWR Connettore tipo W237-102 (Opzionale)
    Q1 Quarzo 4MHZ
    R1 10k 1/4w
    R2 10k 1/4w (Opzionale – Solo in caso di supporto WIFI)
    R3 20k 1/4w (Opzionale – Solo in caso di supporto WIFI)
    R4 220 1/4w
    RESET1 Microswitch
    RESET2 Microswitch (Opzionale – Solo in caso di supporto WIFI)
    SV2 Connettore pin

    Programmazione

    Io utilizzo Xcode e CrossPack for AVR Development in ambiente Mac.

    In ambiente Windows vi consiglio di utilizzare Atmel Studio 7 ma sembra che recentemente sia stato sostituito da un altro prodotto: https://www.microchip.com/en-us/tools-resources/develop/microchip-studio. Se utilizzate Atmel Studio ricordate di selezionare l’Attiny2313a come chip durante la creazione del progetto ed eseguire i seguenti step:

    Come programmatore hardware per l’ISP ho utilizzato l’USBtinyISP:

    usbtinyisp

    1. Impostazione FUSE bits

    Questa procedura deve essere eseguita solo una volta poichè serve a settare le impostazioni di base del bootloader del chip

    • Utilizzare AVR Calculator per ottenere la stringa corretta (http://www.engbedded.com/fusecalc)

      ESEMPI:

      /* Oscillatore interno 1MHZ */     						-U lfuse:w:0x64:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
      /* Quarzo esterno da 3 a 8MHZ */   						-U lfuse:w:0xfd:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
      /* Quarzo esterno da 16MHZ con CKDIV8 e frequenza effettiva 2MHZ */		-U lfuse:w:0x5e:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m     
      
    • Impostare i FUSE Bits nell’Attiny2313:

      avrdude -c usbtiny -p t2313 -e -U lfuse:w:0xfd:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
      

    2a. Compilazione su Xcode (Mac)

    • Modificare le righe seguenti nel file Makefile (ATTENZIONE: la riga FUSES deve essere identica alle impostazioni di FUSE Bits dell’Attiny2313; in questo esempio si utilizza un quarzo esterno da 4MHZ):
       DEVICE     = attiny2313
       CLOCK      = 4000000
       PROGRAMMER = -c usbtiny -p attiny2313
       OBJECTS    = main.o
       FUSES      = -U lfuse:w:0xFD:m -U hfuse:w:0xDF:m -U efuse:w:0xFF:m -U lock:w:0xFF:m
      
    • effettuare build (verrà generato main.hex)

    2b. Compilazione su Atmel Studio (Windows)

    • Menu Build->Build “nome progetto”

    3. Collegare l’USBtinyISP

    • Assicurarsi di aver correttamente collegato il programmatore al computer e di aver installato i driver per il suo funzionamento (su Mac non è necessario installare driver)

    • Collegare l’USBtinyISP al connettore SV2

    4a. Flash su Mac

    • Caricare il file .hex nel chip:
      avrdude -c usbtiny -p t2313 -e -U flash:w:main.hex
      

    4b. Flash su Windows (Atmel Studio)

    Utilizzo dell’ESP01 per il supporto WIFI

    esp01

    L’ESP01 è un modulo SOC basato sul chip ESP8266 che permette di aggiungere il supporto al WIFI in modo semplice ed economico. Prima di inserirlo sulla jefBoard è necessario fare una precisazione: L’ESP01 viene fornito generalmente con un firmware dotato di soli comandi AT per cui prima di utilizzarlo nei nostri progetti è necessario caricare il firmware nodeMCU (https://it.wikipedia.org/wiki/NodeMCU). Con questo firmware è possibile programmare facilmente l’ESP01 tramite linguaggio LUA ed è possibile compilare una versione custom di nodeMCU con il supporto delle librerie/funzionalità necessarie in base all’utilizzo su https://nodemcu-build.com.

    E’ necessario inoltre dotarsi di un adattore USB seriale TTL:

    adattatore

    Istruzioni per l’installazione di esptool su MACOSX:

    • Scaricare e scompattare esptool (https://github.com/espressif/esptool)

    • Assicurarsi di avere Python 1.7 o successivo installato sul sistema

    • Spostarsi sulla directory appena scompattata ed eseguire:

      sudo python setup.py install
      

    Istruzioni per flash nodemcu su ESP01

    Esistono tanti modi per abilitare la modalità flash su ESP-01 (una ricerca su google è altamente consigliata…). Tempo fa ho realizzato una scheda che per comodità mi permette di riavviare tramite reset l’ESP01 (pulsante 1) mentre metto a massa il pin GPIO0 (pulsante 2):

    • Posizionare l’ESP01 e l’interfaccia seriale/USB sulla scheda di programmazione:

      adattatore

    • Per settare l’ESP01 in modalità flash tenere premuto il pulsante 2 e contemporaneamente effettuare un reset premendo e rilasciando il pulsante 1; dopo qualche istante rilasciare il pulsante 2.

    • Effettuare il comando (nodemcu_base_int.bin è il nome del file del firmware nodemcu da flashare vedi cartella esp8266):

      python esptool.py --port /dev/tty.wchusbserialfa140 write_flash 0x00000 nodemcu_base_int.bin
      
    • (opzionale) restore firmware originale (11/12/2019)

      python esptool.py --port /dev/tty.wchusbserialfd130 write_flash 0x00000 v0.9.2.2\ AT\ Firmware.bin
      

    Programmazione ESP01 tramite script LUA

    Una volta caricato il firmware nodeMCU è possibile caricare gli script LUA. Il file denominato init.lua viene caricato all’avvio in maniera automatica. E’ possibile utilizzare il software ESPlorer (https://github.com/4refr0nt/ESPlorer) sia per caricare sia gli script LUA che per gestire al meglio l’ESP01.

    Utilizzo di jefBoard come server WIFI

    In questo caso l’ESP01 funge da server in ascolto sulla porta 8080 tramite connessione WIFI; Ricevuto il comando lo inoltra tramite la connessione seriale verso l’Attiny2313. Per questo utilizzo è necessario che la scheda sia equipaggiata con l’ESP01 aggiornata con il firmware nodeMCU, ed i relativi componenti. Di seguito un esempio di file init.lua (da caricare sull’ESP01) e del codice da utilizzare sull’Attiny2313:

    init.lua (ESP01)

    wifi.setmode(wifi.SOFTAP)
    cfg={}
    cfg.ssid="jefBoard"
    wifi.ap.config(cfg)
    
    uart.setup(0, 9600, 8, uart.PARITY_NONE, uart.STOPBITS_1, 1)
    
    sv = net.createServer(net.TCP, 30)
    
    function receiver(sck, data)
      print(data)  --senda data to jefBoard by serial
    end
    
    if sv then
      sv:listen(8080, function(conn)
        conn:on("receive", receiver)    
      end)
    end
    

    main.c (jefBoard/Attiny2313)

    #define F_CPU 4000000 UL // 4 MHz Crystal
    
    #include <avr/io.h>
    #include <util/delay.h>
    #include <avr/interrupt.h>
    
    // Define baud rate
    #define USART_BAUDRATE 9600
    #define BAUD_PRESCALE(((F_CPU / (USART_BAUDRATE * 16 UL))) - 1)
    
    volatile unsigned char value;
    /* This variable is volatile so both main and RX interrupt can use it.
     It could also be a uint8_t type */
    
    /* Interrupt Service Routine for Receive Complete
     NOTE: vector name changes with different AVRs see AVRStudio -
     Help - AVR-Libc reference - Library Reference - <avr/interrupt.h>: Interrupts
     for vector names other than USART_RX_vect for Attiny2313 */
    
    void dosomething(); //Exec something
    
    void USART_Init(void) {
      // Set baud rate
      UBRRL = BAUD_PRESCALE; // Load lower 8-bits into the low byte of the UBRR register
      UBRRH = (BAUD_PRESCALE >> 8);
      /* Load upper 8-bits into the high byte of the UBRR register
       Default frame format is 8 data bits, no parity, 1 stop bit
       to change use UCSRC, see AVR datasheet*/
    
      // Enable receiver and transmitter and receive complete interrupt
      UCSRB = ((1 << TXEN) | (1 << RXEN) | (1 << RXCIE));
    }
    
    void USART_SendByte(uint8_t u8Data) {
    
      // Wait until last byte has been transmitted
      while ((UCSRA & (1 << UDRE)) == 0);
    
      // Transmit data
      UDR = u8Data;
    }
    
    // not being used but here for completeness
    // Wait until a byte has been received and return received data
    uint8_t USART_ReceiveByte() {
      while ((UCSRA & (1 << RXC)) == 0);
      return UDR;
    }
    
    ISR(USART_RX_vect) {
      if (UDR != 0x0A) value = UDR; //read UART register into value except <RETURN> key
    }
    
    void dosomething() {
      //Exec something    
    }
    
    int main(void) {
    
      USART_Init(); // Initialise USART
      sei(); // enable all interrupts
    
      //If received data from serial match 'd' char exec dosomething() function
      while (1) {
        if (value == 0x64) dosomething(); //ASCII for 'd'     
      }
    
      return 0;
    }
    

    Contatti

    giuseppe.culotta@gmail.com

    Visit original content creator repository https://github.com/jef238/jefBoard
  • jefBoard

    jefBoard

    example

    Cos’è

    JefBoard è una scheda di sviluppo basata sul microcontroller Attiny2313 della ATMEL. Si presta allo sviluppo di applicazioni di varia natura e integra la predisposizione per la scheda WiFI ESP-01 (Opzionale) e il connettore per la programmazione ISP dell’Attiny2313. Alcune caratteristiche:

    • JefBoard espone tutti i pin dell’Attiny2313 per il loro utilizzo.
    • JefBoard permette la realizzazione di applicazioni con supporto WiFi (il modulo ESP-01 comunica tramite connessione seriale con l’Attiny2313).
    • JefBoard può essere assemblata anche senza l’ESP-01 e relativi componenti di alimentazione se non si necessita di supporto WiFi abbassando ulteriormente il costo.
    • JefBoard è una scheda di piccole dimensioni 6×4 cm.

    Attiny 2313 pinout

    example

    Schema ed elenco componenti

    example

    PCB Layout

    Per reperire la PCB scrivi al mio indirizzo giuseppe.culotta@gmail.com

    example

    pcb

    jefboard_r

    Elenco componenti

    Sigla Valore Tipo Note
    C1 100n Condensatore poliestere
    C2 100u Condensatore elettrolitico
    C4 10u Condensatore elettrolitico (Opzionale – Solo in caso di supporto WIFI)
    C5 22p Condensatore ceramico
    C6 22p Condensatore ceramico
    ESP01 Connettore pin (Opzionale – Solo in caso di supporto WIFI)
    IC1 ATtiny2313/ATtiny2313a AVR
    IC2 LM1117DTX 3.3V (Opzionale – Solo in caso di supporto WIFI)
    JP1 Connettore tipo M100.1 (Opzionale)
    JP2 Connettore tipo M100.1 (Opzionale)
    LED1 LED3MM
    PWR Connettore tipo W237-102 (Opzionale)
    Q1 Quarzo 4MHZ
    R1 10k 1/4w
    R2 10k 1/4w (Opzionale – Solo in caso di supporto WIFI)
    R3 20k 1/4w (Opzionale – Solo in caso di supporto WIFI)
    R4 220 1/4w
    RESET1 Microswitch
    RESET2 Microswitch (Opzionale – Solo in caso di supporto WIFI)
    SV2 Connettore pin

    Programmazione

    Io utilizzo Xcode e CrossPack for AVR Development in ambiente Mac.

    In ambiente Windows vi consiglio di utilizzare Atmel Studio 7 ma sembra che recentemente sia stato sostituito da un altro prodotto: https://www.microchip.com/en-us/tools-resources/develop/microchip-studio. Se utilizzate Atmel Studio ricordate di selezionare l’Attiny2313a come chip durante la creazione del progetto ed eseguire i seguenti step:

    Come programmatore hardware per l’ISP ho utilizzato l’USBtinyISP:

    usbtinyisp

    1. Impostazione FUSE bits

    Questa procedura deve essere eseguita solo una volta poichè serve a settare le impostazioni di base del bootloader del chip

    • Utilizzare AVR Calculator per ottenere la stringa corretta (http://www.engbedded.com/fusecalc)

      ESEMPI:

      /* Oscillatore interno 1MHZ */     						-U lfuse:w:0x64:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
      /* Quarzo esterno da 3 a 8MHZ */   						-U lfuse:w:0xfd:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
      /* Quarzo esterno da 16MHZ con CKDIV8 e frequenza effettiva 2MHZ */		-U lfuse:w:0x5e:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m     
      
    • Impostare i FUSE Bits nell’Attiny2313:

      avrdude -c usbtiny -p t2313 -e -U lfuse:w:0xfd:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
      

    2a. Compilazione su Xcode (Mac)

    • Modificare le righe seguenti nel file Makefile (ATTENZIONE: la riga FUSES deve essere identica alle impostazioni di FUSE Bits dell’Attiny2313; in questo esempio si utilizza un quarzo esterno da 4MHZ):
       DEVICE     = attiny2313
       CLOCK      = 4000000
       PROGRAMMER = -c usbtiny -p attiny2313
       OBJECTS    = main.o
       FUSES      = -U lfuse:w:0xFD:m -U hfuse:w:0xDF:m -U efuse:w:0xFF:m -U lock:w:0xFF:m
      
    • effettuare build (verrà generato main.hex)

    2b. Compilazione su Atmel Studio (Windows)

    • Menu Build->Build “nome progetto”

    3. Collegare l’USBtinyISP

    • Assicurarsi di aver correttamente collegato il programmatore al computer e di aver installato i driver per il suo funzionamento (su Mac non è necessario installare driver)

    • Collegare l’USBtinyISP al connettore SV2

    4a. Flash su Mac

    • Caricare il file .hex nel chip:
      avrdude -c usbtiny -p t2313 -e -U flash:w:main.hex
      

    4b. Flash su Windows (Atmel Studio)

    Utilizzo dell’ESP01 per il supporto WIFI

    esp01

    L’ESP01 è un modulo SOC basato sul chip ESP8266 che permette di aggiungere il supporto al WIFI in modo semplice ed economico. Prima di inserirlo sulla jefBoard è necessario fare una precisazione: L’ESP01 viene fornito generalmente con un firmware dotato di soli comandi AT per cui prima di utilizzarlo nei nostri progetti è necessario caricare il firmware nodeMCU (https://it.wikipedia.org/wiki/NodeMCU). Con questo firmware è possibile programmare facilmente l’ESP01 tramite linguaggio LUA ed è possibile compilare una versione custom di nodeMCU con il supporto delle librerie/funzionalità necessarie in base all’utilizzo su https://nodemcu-build.com.

    E’ necessario inoltre dotarsi di un adattore USB seriale TTL:

    adattatore

    Istruzioni per l’installazione di esptool su MACOSX:

    • Scaricare e scompattare esptool (https://github.com/espressif/esptool)

    • Assicurarsi di avere Python 1.7 o successivo installato sul sistema

    • Spostarsi sulla directory appena scompattata ed eseguire:

      sudo python setup.py install
      

    Istruzioni per flash nodemcu su ESP01

    Esistono tanti modi per abilitare la modalità flash su ESP-01 (una ricerca su google è altamente consigliata…). Tempo fa ho realizzato una scheda che per comodità mi permette di riavviare tramite reset l’ESP01 (pulsante 1) mentre metto a massa il pin GPIO0 (pulsante 2):

    • Posizionare l’ESP01 e l’interfaccia seriale/USB sulla scheda di programmazione:

      adattatore

    • Per settare l’ESP01 in modalità flash tenere premuto il pulsante 2 e contemporaneamente effettuare un reset premendo e rilasciando il pulsante 1; dopo qualche istante rilasciare il pulsante 2.

    • Effettuare il comando (nodemcu_base_int.bin è il nome del file del firmware nodemcu da flashare vedi cartella esp8266):

      python esptool.py --port /dev/tty.wchusbserialfa140 write_flash 0x00000 nodemcu_base_int.bin
      
    • (opzionale) restore firmware originale (11/12/2019)

      python esptool.py --port /dev/tty.wchusbserialfd130 write_flash 0x00000 v0.9.2.2\ AT\ Firmware.bin
      

    Programmazione ESP01 tramite script LUA

    Una volta caricato il firmware nodeMCU è possibile caricare gli script LUA. Il file denominato init.lua viene caricato all’avvio in maniera automatica. E’ possibile utilizzare il software ESPlorer (https://github.com/4refr0nt/ESPlorer) sia per caricare sia gli script LUA che per gestire al meglio l’ESP01.

    Utilizzo di jefBoard come server WIFI

    In questo caso l’ESP01 funge da server in ascolto sulla porta 8080 tramite connessione WIFI; Ricevuto il comando lo inoltra tramite la connessione seriale verso l’Attiny2313. Per questo utilizzo è necessario che la scheda sia equipaggiata con l’ESP01 aggiornata con il firmware nodeMCU, ed i relativi componenti. Di seguito un esempio di file init.lua (da caricare sull’ESP01) e del codice da utilizzare sull’Attiny2313:

    init.lua (ESP01)

    wifi.setmode(wifi.SOFTAP)
    cfg={}
    cfg.ssid="jefBoard"
    wifi.ap.config(cfg)
    
    uart.setup(0, 9600, 8, uart.PARITY_NONE, uart.STOPBITS_1, 1)
    
    sv = net.createServer(net.TCP, 30)
    
    function receiver(sck, data)
      print(data)  --senda data to jefBoard by serial
    end
    
    if sv then
      sv:listen(8080, function(conn)
        conn:on("receive", receiver)    
      end)
    end
    

    main.c (jefBoard/Attiny2313)

    #define F_CPU 4000000 UL // 4 MHz Crystal
    
    #include <avr/io.h>
    #include <util/delay.h>
    #include <avr/interrupt.h>
    
    // Define baud rate
    #define USART_BAUDRATE 9600
    #define BAUD_PRESCALE(((F_CPU / (USART_BAUDRATE * 16 UL))) - 1)
    
    volatile unsigned char value;
    /* This variable is volatile so both main and RX interrupt can use it.
     It could also be a uint8_t type */
    
    /* Interrupt Service Routine for Receive Complete
     NOTE: vector name changes with different AVRs see AVRStudio -
     Help - AVR-Libc reference - Library Reference - <avr/interrupt.h>: Interrupts
     for vector names other than USART_RX_vect for Attiny2313 */
    
    void dosomething(); //Exec something
    
    void USART_Init(void) {
      // Set baud rate
      UBRRL = BAUD_PRESCALE; // Load lower 8-bits into the low byte of the UBRR register
      UBRRH = (BAUD_PRESCALE >> 8);
      /* Load upper 8-bits into the high byte of the UBRR register
       Default frame format is 8 data bits, no parity, 1 stop bit
       to change use UCSRC, see AVR datasheet*/
    
      // Enable receiver and transmitter and receive complete interrupt
      UCSRB = ((1 << TXEN) | (1 << RXEN) | (1 << RXCIE));
    }
    
    void USART_SendByte(uint8_t u8Data) {
    
      // Wait until last byte has been transmitted
      while ((UCSRA & (1 << UDRE)) == 0);
    
      // Transmit data
      UDR = u8Data;
    }
    
    // not being used but here for completeness
    // Wait until a byte has been received and return received data
    uint8_t USART_ReceiveByte() {
      while ((UCSRA & (1 << RXC)) == 0);
      return UDR;
    }
    
    ISR(USART_RX_vect) {
      if (UDR != 0x0A) value = UDR; //read UART register into value except <RETURN> key
    }
    
    void dosomething() {
      //Exec something    
    }
    
    int main(void) {
    
      USART_Init(); // Initialise USART
      sei(); // enable all interrupts
    
      //If received data from serial match 'd' char exec dosomething() function
      while (1) {
        if (value == 0x64) dosomething(); //ASCII for 'd'     
      }
    
      return 0;
    }
    

    Contatti

    giuseppe.culotta@gmail.com

    Visit original content creator repository https://github.com/jef238/jefBoard
  • BrightPath

    Netlify Status Frontend Backend

    BrightPath Online Course Platform

    Created by the Go Getters

    Project Vision Statement

    During this six-week Chingu voyage, our team will design, develop, and launch BrightPath, a custom platform for online courses that will cover niche tech topics not currently addressed elsewhere. All courses—including videos, readings, activities, and quizzes—will be freely available to the public. Users can log in to access course content and track their progress. Upon completing all required lessons and assessments for a given course, users will be issued a verified BrightPath certificate that can be shared on LinkedIn and other web platforms to demonstrate their achievement. Our practical, project-based courses will help learners stay at the forefront of the ever-evolving tech landscape.


    Primary Links


    About the Project

    BrightPath is built to offer free, project-based learning experiences. Users will find interactive content, gain hands-on skills, and earn verifiable certificates that showcase their achievements.

    Features

    • Free, Public Access: Courses are freely accessible to all users.
    • Personalized Learning: Login functionality enables users to track their progress.
    • Certificates of Completion: Highlight learning accomplishments on LinkedIn or other platforms.
    • Rich Content: Courses include videos, readings, activities, and assessments.

    Tech Stack

    • Frontend: Next.js (hosted on Netlify)
    • Backend: Express.js (hosted on Railway)
    • Database: PostgreSQL
    • Other: OAuth Authentication

    We invite you to explore the platform and join us in shaping the future of online learning! 🎓✨

    Team Documents

    You may find these helpful as you work together to organize your project.

    Meeting Agenda templates (located in the /docs directory in this repo):

    • Meeting – Voyage Kickoff –> ./docs/meeting-voyage_kickoff.docx
    • Meeting – App Vision & Feature Planning –> ./docs/meeting-vision_and_feature_planning.docx
    • Meeting – Sprint Retrospective, Review, and Planning –> ./docs/meeting-sprint_retrospective_review_and_planning.docx
    • Meeting – Sprint Open Topic Session –> ./docs/meeting-sprint_open_topic_session.docx

    Our Team

    Everyone on your team should add their name along with a link to their GitHub & optionally their LinkedIn profiles below. Do this in Sprint #1 to validate your repo access and to practice PR’ing with your team before you start coding!

    Visit original content creator repository https://github.com/chingu-voyages/BrightPath
  • VersionCheck

    VersionCheck

    Check a GitHub repository for info about releases. With this
    your code can react to the info returned.

    Purpose

    Restore a level of control to a creator who cares enough
    about their content to implement a solution, like what
    is found in this repository, when a platform limits their
    choices. Necessity is the mother of invention

    How it works

    The Version Check Client fetches info from a GitHub repository
    and looks for infomation in the repository’s ReadMe or Releases.
    The two modes are explained below.

    WARNING: The GitHub API throttles at 5000 requests per hour.
    Please do not abuse.

    Modes

    ReadMe

    The ReadMe mode fetches the README files from a repository.
    The file can be named README.md or README. It is case insensitive.
    If GitHub auto displays your readme file when browsing to your
    repository then this code will work.

    The content of the README file is parsed looking for html
    comments in the format below.

    <!-- name|version|IsDisabled -->

    Field Description
    name This value is mapped to ReadMeValues.Name
    version This value is mapped to ReadMeValues.Version
    IsDisabled This value is mapped to ReadMeValues.IsDisabled as true or false. It only maps to true if the value is IsDisabled. Anything else maps to false.

    Example Readme.md

    In this example all pre-v1.0.0 version of the digitalroot.mods.betterclubs mod are disabled.

    <!-- digitalroot.mods.betterclubs|1.0.1|IsEnabled --> <!-- digitalroot.mods.betterclubs|1.0.0|IsEnabled --> <!-- digitalroot.mods.betterclubs|0.9.0|IsDisabled --> <!-- digitalroot.mods.betterclubs|0.9.1|IsDisabled -->

    Releases

    The Releases mode fetches all the Releases from a repository.
    The content of the Releases (body) is parsed looking for an html
    comment in the format below.

    <!-- IsDisabled -->

    Field Description
    Name of the release This value is mapped to Release.Name
    Tag name of the release This value is mapped to Release.Tag
    IsDisabled This value is mapped to Release.IsDisabled as true or false. It only maps to true if <!-- IsDisabled --> is found in the release body. If it is not found then Release.IsDisabled is set to false.


    Errors

    If the VersionCheckClient encounters any errors, Results.IsErrored
    is set to true and Results.Exception is set to the exception encountered.

    Installation

    Install it as a NuGet package.

    • Supports
      • .NET Standard 2.1
      • .NET 4.6.2
      • .NET 4.7.2
      • .NET 4.8
    Package Manager

    PM> Install-Package Digitalroot.Valheim.VersionCheck

    .NET CLI

    dotnet add package Digitalroot.Valheim.VersionCheck

    How to use

    There are many ways to use the this library. What an author does
    with a disabled release is left up to the author. Here are a few examples.

    ReadMe

    // GitHub repository url format. https://github.com/githubtraining/hellogitworld
    // GitHub repository url format. https://github.com/{owner}/{name}
    
    // Create VersionCheckClient
    using var versionCheckClient = new VersionCheckClient("githubtraining", "hellogitworld", VersionCheckMode.ReadMe);
    
    // Execute the request
    var results = versionCheckClient.Execute();
    
    // Get the result for a specific name and version.
    var readMeValues = results.ReadMeValues.FirstOrDefault(r => r.Name == "digitalroot.mods.betterclubs" && r.Version == "1.0.0");
    
    if (readMeValues?.IsDisabled == true)
    {
      // The release is marked as disabled.
      // Add your code here for how you want to handle a disabled release.
    }
    else
    {
      // The release was not found or it is not marked as disabled.
      // Add your code here for how you want to handle an enabled release.
    }

    Releases

    // GitHub repository url format. https://github.com/githubtraining/hellogitworld
    // GitHub repository url format. https://github.com/{owner}/{name}
    
    // Create VersionCheckClient
    using var versionCheckClient = new VersionCheckClient("githubtraining", "hellogitworld", VersionCheckMode.Releases);
    
    // Execute the request
    var results = versionCheckClient.Execute();
    
    // Get the result for a specific tag.
    var release = results.Releases.FirstOrDefault(r => r.Tag == "RELEASE_1.1");
    
    if (release?.IsDisabled == true)
    {
      // The release is marked as disabled.
      // Add your code here for how you want to handle a disabled release.
    }
    else
    {
      // The release was not found or it is not marked as disabled.
      // Add your code here for how you want to handle an enabled release.
    }

    Example with a mod using Jotunn

    namespace Digitalroot.Valheim.BetterClubs
    {
      [BepInPlugin(Guid, Name, Version)]
      public class Main : BaseUnityPlugin
      {
        public const string Version = "1.0.0";
        public const string Name = "Digitalroot Better Clubs";
        public const string Guid = "digitalroot.mods.betterclubs";
    
        private void Awake()
        {
          using var versionCheckClient = new VersionCheckClient("MyGitHubUserName", "MyGitHubRepoName", VersionCheckMode.ReadMe);
          var results = versionCheckClient.Execute();
          var readMeValues = results.ReadMeValues.FirstOrDefault(r => r.Name == Guid && r.Version == Version);
    
          if (readMeValues == null || readMeValues.IsDisabled == false)
          {
            AddLocalizations();
            ItemManager.OnVanillaItemsAvailable += AddClonedItems;
          }
        }
      }
    }

    Example with a mod using BepInEx

    namespace Digitalroot.Valheim.BetterClubs
    {
      [BepInPlugin(Guid, Name, Version)]
      public class Main : BaseUnityPlugin
      {
        public const string Version = "1.0.0";
        public const string Name = "Digitalroot Better Clubs";
        public const string Guid = "digitalroot.mods.betterclubs";
        private Harmony _harmony;
    
        private void Awake()
        {
          using var versionCheckClient = new VersionCheckClient("MyGitHubUserName", "MyGitHubRepoName", VersionCheckMode.ReadMe);
          var results = versionCheckClient.Execute();
          var readMeValues = results.ReadMeValues.FirstOrDefault(r => r.Name == Guid && r.Version == Version);
    
          if (readMeValues == null || readMeValues.IsDisabled == false)
          {
            _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), Guid);
          }
        }
      }
    }

    Disclamer

    Any refrences or inference to anything real, anyone real or
    real events is unintentional and purely coincidental.

    Visit original content creator repository
    https://github.com/Digitalroot-Valheim/VersionCheck