Blog

  • result-react-002-3-basic-calc

    result-react-002-3-basic-calc

    Small react-app of basic (addition and subtraction) operations of calculating integers

    Getting Started with Create React App

    This project was bootstrapped with
    Create React App.

    Available Scripts

    In the project directory, you can run:

    npm start

    Runs the app in the development mode.
    Open http://localhost:3000 to view it in your browser.

    The page will reload when you make changes.
    You may also see any lint errors in the console.

    npm test

    Launches the test runner in the interactive watch mode.
    See the section about running tests
    for more information.

    npm run build

    Builds the app for production to the build folder.
    It correctly bundles React in production mode and optimizes the build for the best performance.

    The build is minified and the filenames include the hashes.
    Your app is ready to be deployed!

    See the section about
    deployment for more
    information.

    npm run eject

    Note: this is a one-way operation. Once you eject, you can’t go back!

    If you aren’t satisfied with the build tool and configuration choices, you can eject at
    any time. This command will remove the single build dependency from your project.

    Instead, it will copy all the configuration files and the transitive dependencies
    (webpack, Babel, ESLint, etc) right into your project so you have full control over them.
    All of the commands except eject will still work, but they will point to the copied
    scripts so you can tweak them. At this point you’re on your own.

    You don’t have to ever use eject. The curated feature set is suitable for small and
    middle deployments, and you shouldn’t feel obligated to use this feature. However we
    understand that this tool wouldn’t be useful if you couldn’t customize it when you are
    ready for it.

    Learn More

    You can learn more in the
    Create React App documentation.

    To learn React, check out the React documentation.

    Code Splitting

    This section has moved here:
    https://facebook.github.io/create-react-app/docs/code-splitting

    Analyzing the Bundle Size

    This section has moved here:
    https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

    Making a Progressive Web App

    This section has moved here:
    https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

    Advanced Configuration

    This section has moved here:
    https://facebook.github.io/create-react-app/docs/advanced-configuration

    Deployment

    This section has moved here:
    https://facebook.github.io/create-react-app/docs/deployment

    npm run build fails to minify

    This section has moved here:
    https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

    Visit original content creator repository
    https://github.com/Deemon13/result-react-002-3-basic-calc

  • og

    Introduction

    OG.cool is a demo that shows you how you can display headlines directly inside your news article’s OG image. Powered by @vercel/og.

    Read the guide to learn more about how you can implement your own version: https://vercel.com/guides/displaying-article-headlines-in-social-previews

    How it works

    To try out OG.cool, all you need to do is replace the https:// (or https://www.) portion of the news article’s URL with https://og.cool/.

    Example:

    The OG.cool URL will still redirect to the destination URL when a user clicks on it, but for bots like TwitterBot or SlackBot, they’ll be shown an OG image with a nice headline in it (refer Examples section).

    OG.cool currently supports the following publications:

    • New York Times
    • Wired
    • Techcrunch

    Examples

    New York Times

    image

    Try it for yourself: https://og.cool/nytimes.com/2023/08/23/climate/ocean-warming-fish.html (OG image preview)

    Wired

    image

    Try it for yourself: https://og.cool/wired.com/story/adhd-adderall-video-games-endeavorrx/ (OG image preview)

    Visit original content creator repository https://github.com/steven-tey/og
  • markdeep

    Markdeep Clone

    This is an unofficial un-minified version of markdeep.mini.js.

    http://casual-effects.com/markdeep/

    As of 0.10 (2016-03-22), releases are signed with Minisign.

    Minisign is a ‘dead simple tool to sign files and verify signatures’. Signed files will be accompanied by a corresponding *.minisig file.

    You can verify the signature using my Minisign public key:

    minisign -Vm <file> -P RWSmY4o5Bad1vS60aYAiQUswWYVV2EuSdqc3ry7CWWF1E6bVbFG9kR/y
    

    Authenticate the key above by copying the signature below, into keybase.io/verify. It’s signed by 14C1182BC57936B2.

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    RWSmY4o5Bad1vS60aYAiQUswWYVV2EuSdqc3ry7CWWF1E6bVbFG9kR/y
    -----BEGIN PGP SIGNATURE-----
    
    wsFcBAABCgAGBQJX010gAAoJEBTBGCvFeTayH+UP/2cc+UNhGyDdLACyv7+eHI93
    NAdskZQ+d8iiOkxgiMXoTg3W9/B6skRL5eZIX1QTgg7xldVcczOUr9/7/fGhQMHB
    vEU6RwB/SnyRSqPiqnbsP8K7Xl6GHty2VorIKWR3zPCFSdMq2sOYJVXR0IZrB5O5
    jMzkBLZQMUH+fgeiapassjN8hzl8Gc0A8HO48MVSsS2MQx05DN9uqAnX5XzY6dQL
    jA9AatVTsx904fgz3TJogEOCoEbPSl02zZ5J5uRGMA5e5cyWU9+rTL4hhN/6HrAA
    6Oe4ihEEGECTxC59LEgbPTxka8QU0ngrgVzrJZxBI7Q05oyznGazFWtJz53cxp60
    b8jBht+PeVBnoKCodmAZu54N3f5BTNMldivvclRJDv0TAOJZK/UJW52BdBqrEHek
    luFxCBlJ7MQe56fiQwCS1+KIBTTOzxFtQAi35gcZv/mqb2WRMBJWCtB4f0NC9TqT
    BShvxk8N4z7yVZiykjpdHxslNtfoVR1iRcZ0+xVQBtT+pEdl5ONexSazUsvKXGxR
    g9IKP0qTNBu38lHDZSABsb3b+WTax+xDd/mcZC3SJO9aFXPP0uoL0ON1JpB/d0FQ
    54ixCr4VK9aO9RNZuvV9yYKWTsNXh3hqY+AuRfv4Cv0YkEnqKVgUUozIkSI9WP57
    rkYQXUCXXP1XUMDpJCfo
    =BL+u
    -----END PGP SIGNATURE-----
    

    signature mirror

    Markdeep is a technology for writing plain text documents that will look good in any web browser. It supports diagrams, common styling conventions, and equations as extensions of Markdown syntax.

    Markdeep is free and easy to use. It doesn’t need a plugin, or Internet connection. There’s nothing to install. Just start writing in Vi, Nodepad, Emacs, Visual Studio, Atom, or another editor! You don’t have to export, compile, or otherwise process your document.

    Markdeep is ideal for design documents, specifications, README files, code documentation, lab reports, and technical web pages. Because the source is plain text, Markdeep works well with software development toolchains.

    Markdeep was created by Morgan McGuire at Casual Effects with inspiration from John Gruber’s Markdown. The current minified-only beta release is public in order to find bugs and get feedback, but a full and stable version with natural source is coming soon after some more code cleanup.

    Style Features

    Unique features:

    • Diagrams
    • Title formatting
    • CSS stylable
    • Title and subtitle detection
    • Section numbering
    • Equation typesetting and numbering
    • Works in any browser by adding one line to the bottom of a text document
    • Fallback to ASCII in a browser if you have neither the local file or Internet access

    Plus, best-of-breed Maruku Markdown features:

    • Tables
    • Paragraph formatting
    • Automatic e-mail address and URL linking
    • Nested, numbered and bulleted lists
    • Fenced code blocks
    • Bold, italic, code, strikethrough
    • Hyperlinks
    • Blockquotes
    • Images
    • Doesn’t italicize math with * or words containing underscores
    • Unicode
    • HTML passthrough
    • Optionally process server-side or offline in Node.js

    Get Started

    To create a Markdeep document, just open any text editor and start writing. Paste the following at the bottom of your document as a single line. Then, save it as plain text with a filename with extension .md.html.

    <style class="fallback">body{white-space:pre;font-family:monospace}</style><script src="https://github.com/reelsense/markdeep.min.js"></script><script src="http://casual-effects.com/markdeep/latest/markdeep.min.js"></script>
    

    You can drag your document into a web browser or double click on it to see it with formatting. You can also read the document in a browser when you don’t have an Internet connection. If you want to avoid losing formatting when offline, just keep markdeep.min.js in the same folder.

    View the plain source of the feature demo to learn the formatting styles that you can use. Markdeep extends Markdown, and to quote John Gruber:

    The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.
    To inspect the original text source for a Markdeep document in a browser, just add ?noformat to the end of its URL.

    Origin and Credits

    I created Markdeep because I was no longer willing to choose between design documents that looked good and those that worked well with programming tools. I liked what Markdown did on web servers, so I used that as a starting point and added more styling features and a way to directly view the documents client side in a browser.

    HTML is “markup” that extends plain text with formatting. Unfortunately, the formatting tags often make original document source hard to read and write. This is slow and annoying, especially for those of us who use programming tools for document editing or want formatting in documentation files.

    John Gruber invented Markdown to address HTML’s editing problems. The name “mark**down” conveys styling in the opposite direction of the “markup**” tag syntax. Markdown beautifies text without explicit tags, based on common practices from ASCII e-mail and plain-text documents

    Markdeep” is farther “down” from “markdown” on the autostyling and beautification path. Markdeep combines an easy-to-use and browser-friendly packaging with new unique features for diagrams. The code includes some of the best previous Javascript document formatting libraries and links to MathJax for equation typesetting

    Markdeep was created by Morgan McGuire. It extends the work of:

    • John Grubber’s original Markdown concept and specification
    • Ben Hollis’ Maruku (aka “Githib”) Markdown dialect specification
    • Michel Fortin’s Extra Markdown dialect specification
    • Dominic Baggott’s markdown.js implementation for table and list processing
    • Ivan Sagalaev’s highlight.js for syntax coloring
    • Contributors to the above open source projects

    License

    Markdeep is open source. You may use, extend, and redistribute Markdeep without charge under the terms of the BSD license:

          Copyright 2015, Morgan McGuire
          All rights reserved.
    
          Redistribution and use in source and binary forms,
          with or without modification, are permitted provided that the
          following conditions are met:
    
          1. Redistributions of source code must retain the above
          copyright notice, this list of conditions and the following
          disclaimer.
    
          2. Redistributions in binary form must reproduce the above
          copyright notice, this list of conditions and the following
          disclaimer in the documentation and/or other materials provided
          with the distribution.
    
          THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
          CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
          INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
          MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
          DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
          CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
          SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
          LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
          USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
          AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
          LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
          IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
          THE POSSIBILITY OF SUCH DAMAGE.
    

    Markdeep includes markdown.js, so you are also bound by the MIT license (which is BSD-compatible):

          Permission is hereby granted, free of charge, to any person
          obtaining a copy of this software and associated documentation
          files (the "Software"), to deal in the Software without
          restriction, including without limitation the rights to use,
          copy, modify, merge, publish, distribute, sublicense, and/or
          sell copies of the Software, and to permit persons to whom the
          Software is furnished to do so, subject to the following
          conditions:
    
          The above copyright notice and this permission notice shall be
          included in all copies or substantial portions of the Software.
    
          THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
          EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
          OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
          NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
          HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
          WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
          FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
          OTHER DEALINGS IN THE SOFTWARE.
    

    …and the highlight.js BSD license:

          Copyright (c) 2006, Ivan Sagalaev
          All rights reserved.
    
          Redistribution and use in source and binary forms, with or
          without modification, are permitted provided that the following
          conditions are met:
    
          * Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
          * Redistributions in binary form must reproduce the above copyright
          notice, this list of conditions and the following disclaimer in the
          documentation and/or other materials provided with the distribution.
          * Neither the name of highlight.js nor the names of its contributors
          may be used to endorse or promote products derived from this software
          without specific prior written permission.
    
          THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS
          IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
          LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
          FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
          SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
          INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
          DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
          SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
          BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
          LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
          (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
          THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
          SUCH DAMAGE.
    

    Release History

    Old releases are archived as:

    http://casual-effects.com/markdeep/_VERSION_/markdeep.min.js

    You can modify the Markdeep line at the bottom of a document to hardcode to a specific version instead of the default version of “latest“.

    You can report bugs to morgan@casual-effects.com by sending a Markdeep document and what you think is wrong about the way that it appears.

    • 2018-09-03 Version 1.02

      1. Documented how to add Atom support.
      2. Added .webm video support.
      3. Improved Swedish localization.
      4. Fixed mixed task/bullet/number lists.
      5. Permitted ATX-style headers with # in them.
      6. Fixed trailing blank line in diagrams.
      7. Added support for audio files using video link syntax.
      8. Added optional line numbers on code listings.
    • 2018-07-04 Version 1.01

      1. Fixed alignment of diagrams with no right border of *
      2. Fixed \pagebreak requiring other characters on the same line
      3. Added Czech localization by Jan Toušek
      4. Added support for localized “section” appearing before or after a section title
      5. Made reference link parsing more robust, allowing newlines within the text
      6. Added [x] github style task lists
      7. Fixed multiple (insert … here) statements in a document
      8. Made the apidoc.md.html sample not flash the raw source on load
      9. Stripped links from section titles in the table of contents
      10. Added support for reference images
    • 2018-04-28 Version 1.00: Feature Complete

      1. Fixed use of (include here) with implicit email links.
      2. Added Portuguese localization by Tiago Antão
      3. Added Italian localization by Leonardo Taglialegne
      4. Fixed references not working for localized figure variants
      5. Added support for Gravizo SVG format graphs
      6. Removed browser header/footer when printing to PDF
      7. Support for IE11
      8. Added Lithuanian localization by Warmist
    • 2017-12-31 Version 0.23: Code

      1. Tweaked the apidoc.css style.
      2. Fixed top-level header formatting broken in the previous release.
      3. Code blocks now use four-space tabs (instead of eight spaces).
      4. Added syntax coloring for Go, Rust, R, Lua, TypeScript, and Swift code blocks.
      5. Added support for back-to-back code blocks with no text between them.
      6. Improved robustness of schedule list detection and removed warning messages from speculative parser.
      7. Localized smart quotation marks to the same region as other keywords, following this spec.
      8. Fixed email address detection for 2-letter domains with a patch by Michael Smirnov.
    • 2017-11-25 Version 0.22: Unity

      1. Added support for long <– and –> arrows in body text.
      2. Added support for ordered lists that begin with numbers other than 1.
      3. Markdeep now strips HTML comments that are not in code blocks at the beginning of processing.
      4. Added Japanese localization by Takashi Masuyama.
      5. Added optional CSS classes to fenced code blocks.
      6. Added multiple unioned code blocks for use in highlighting and multi-language examples.
      7. Fixed CSS to not leak outside Markdeep blocks when in html embedding mode.
      8. Added support for LaTeX when in doxygen and html embedding modes.
      9. Added admonitions (callout notes for the reader).
      10. Added apidoc.css stylesheet and corresponding template by Aras Pranckevičius.
    • 2017-10-03 Version 0.21: Robustness

      1. Upgraded to highlight.js 9.12.0, included shell session highlighting.
      2. Fixed excess whitespace due to <p> tags being generated near section headers.
      3. Capitalized “Contents” in English.
      4. Made title and list pattern detection more robust.
      5. Improved parsing of image grids when near other individual images.
      6. Made all images hyperlink to their full-resolution versions.
      7. Improved wide character support for diagrams contributed by Torsten Grust.
      8. Changed implicit URL parsing to consider a trailing period as punctuation instead of part of the URL. Use explicit URL syntax of <http://...> to force it to be part of the URL.
      9. Added an explicit CSS class for tocNumber to support hiding them.
      10. Added support for nested blockquotes.
      11. Fixed indented lists immediately after a header.
    • 2017-06-30 Version 0.20: Customization

      1. Updated Mathjax for files included via (insert) to use cloudflare.
      2. Fixed events from other JavaScript libraries interfering with Markdeep.
      3. Updated wkhtmltopdf instructions to work around bugs in their 0.12.4 version.
      4. Avoided generating empty tags to work around a longstanding wkhtmltopdf bug.
      5. Improved colors for tables in the dark template.
      6. Added Swedish localization by Nils Nilsson.
      7. Added captionAbove option for figures, listings, and tables.
    • 2017-05-27 Version 0.19: Layout

      1. Adjusted the generation of paragraph tags around lists to better support HTML post-processing.
      2. Fixed recursive (insert X here) statements triggering multiple tables of contents.
      3. Renamed showURLs to showLabels and made it display both labels and URLs.
      4. Added localization for the Contents text in the table of contents.
      5. Switched to cloudflare CDN for Mathjax.
      6. Fixed table layout in the presence of an empty first or last column cell.
      7. Added \un Latex macro for units in math.
      8. Added slide template (thanks to Torsten Grust).
      9. Allowed leading space before tables with outside borders.
      10. Added support for single-column tables.
      11. Avoided page breaks after headers.
      12. Improved rendering of high-index Unicode characters in diagrams.
      13. Fixed font-weight of unnumbered H2 sections.
      14. Removed stroke borders from grayscale Unicode blocks in diagrams.
      15. Support for \pagebreak, \newpage, and page breaks with ++++++++.
      16. Made the dark.css style sheet print with a white background.
    • 2017-03-31 Version 0.18: Lists and links

      1. Improved detection of the end of lists followed by indented content
      2. Improved handling of multiple lists within a single schedule list day
      3. Removed console debug output that was accidentally enabled in version 0.17
      4. Defaulted to including the markdeep.min.js script with a trailing ?, to force updates under new aggressive browser caching
      5. Support for subfigures in references, e.g., Figure [dinosaur](a)
      6. Support for quoted URLs (needed for URLs containing unescaped parentheses)
      7. Allowed fenced code blocks to be indented
      8. Added support for both single and double arrows
      9. Fixed incorrect floating on diagrams that lack a right border
      10. Fixed citations at the end of figure captions
    • 2017-02-12 Version 0.17: Style

      1. Diagrams that are not floating may now omit the right-edge markers
      2. Workarounds for WordPress compatibility
      3. Workaround for Firefox-specific bug with canvas in iframe affecting include statements
      4. Allowed listing captions to be up to four lines long
      5. Improved robustness of underscores and italics within words
      6. Added Polish translation by Dariusz Kuśnierek
      7. Added Latex and Dark style sheets.
      8. Documented paragraph numbering
    • 2016-12-20 Version 0.16: Printing support

      1. Removed hyperlinking of svn and perforce URLs (they are still typset as URLs)
      2. Improved Latex single-$ parsing
      3. Fixed lists after unnumbered sections needing too much whitespace
      4. Made horizontal rule parsing more permissive
      5. Made layout avoid page breaks in tables, listings, and images when printed
      6. Experimental insert support
      7. Added version number to Markdeep footer
    • 2016-10-28 Version 0.15: Proof support

      1. Changed windows code font to Consolas because Lucida Console’s capital ‘V’ character is confusingly small.
      2. Now only only floating images have constrained caption widths
      3. Captions are always justified within the centered block
      4. Added showURLs option
      5. Added German and Hungarian localization contributed by Berczi Sándor
      6. “Contents”https://github.com/”Table of Contents” header is now localized
      7. Added console warnings for broken reference links
      8. Added console warnings for unused reference links
      9. Added console warnings for unreferenced figures, tables, etc.
      10. Added console warnings for broken links to figures, tables, etc
    • 2016-09-10 Version 0.14: Robustness

      1. Switched double minus signs to parse as em dash instead of en dash, since they visually resemble em dash in the text.
      2. Corrected parsing of lists with spaces between the elements.
      3. Grids of images are recognized and preserved.
      4. Made table of contents work for documents with incorrect header nesting
      5. Fixed an obscure browser-lockup bug resulting from parsing protected substrings as numbers for later markdown
      6. Fixed protect accidentally generating sequences that look like dimensions.
      7. Fixed links and images within footnotes and bibliography entries.
      8. Increased character count for “short” definition lists to 160 characters.
    • 2016-08-01 Version 0.13: Book support

      1. Added support for youtu.be URL shortened videos
      2. Documented lang advanced option
      3. Exposed tocStyle advanced option
      4. Added support for multiple entries per date in schedule lists
      5. Added support for auto-hiding weekends in schedule lists
      6. Switched all date computations to UTC to avoid daylight time problems
      7. Added parenthesized entries for schedule lists
      8. Added support for arbitrary attributes on regular links
      9. Terse formatting for definition lists with short definitions
      10. Fixed fancy quotes in non-unicode documents
      11. Reduced file size slightly
      12. Improved syntax auto-highlighting in code blocks
    • 2016-06-28 Version 0.12: Localization

      1. Prevented double underscores in variable names inside of diagrams, e.g., __FILE__, from being parsed as lines
      2. Prevented decoration characters from being stripped from diagrams when on false-diagonal lines composed entirely of decorations
      3. Matched fixed-width fonts between diagrams and code blocks, and code block font sizes across platforms
      4. Added localization support via markdeepOptions.lang and <meta lang="..." ...>
      5. Increased robustness of section links
      6. Added unnumbered sections using (#)
    • 2016-05-14 STANDBY Morgan erased /0.11/markdeep.min.js from his server. Wish he used version control.

    • 2016-05-06 Version 0.11: Integration

      1. Added ?export option to extract raw HTML
      2. Switched to font-rendering: antialiased; for lighter fonts
      3. Added support for numeric exponents outside of math mode
      4. Made spaces in figure/listing/table references unbreakable
      5. Fixed processing of max-width and width on images
      6. Added default max-width of 100% on images (can be overriden per image)
      7. Extended minus-sign beautification to negative numbers immediately following an open parenthesis
      8. Tweaked code syntax highlighting
      9. Updated to use highlight.js 0.9.3
      10. Fixed smart quotes after numbers
      11. Made fancy quotes fully CSS-stylable
      12. Made diagrams CSS-stylable
      13. Protected style tags
      14. Protected table of contents link names
      15. Fixed long table of contents link to first section
      16. Added gravizo support
    • 2016-03-22 Version 0.10: Calendars and Images

      1. Fixed alignment in table cells
      2. Added support for links with no text
      3. Added starter.md.html to web page
      4. Switched default raw URL font to Georgia for more weight and better slashes
      5. Table of contents now becomes its own section if it is longer than the abstract
      6. Added support for Latex equation, eqnarray, and equation* environments
      7. Fixed current-day highlighting on calendars
      8. Fixed multiple single-$ Latex expressions on a single line
      9. Allowed definition list terms to begin with non-word characters
      10. Added support for daylight saving time independent of country
      11. Improved robustness of parsing links within image captions
      12. Added support for floating, captioned images
      13. Fixed centering of multiple images in separate blocks
      14. Allowed definition lists to have a single space between the colon and definition
    • 2016-02-02 Version 0.09: References and Internal Links

      1. Added support for schedule lists
      2. 10x performance increase over version 0.08
      3. Added IE11 support
      4. Added support for calendars
      5. Added support for HTML attributes on images
      6. Added support for video
      7. Added CSS classes for different list bullets
      8. Added support for Youtube and Vimeo video
      9. Fixed multiple centered images in a group
      10. Fixed multiple colons in schedule event titles
      11. Added fancy quotes
      12. Highlighted current day on calendars
    • 2016-01-18 Version 0.08: References and Internal Links

      1. Prevented HTML tags in the title from appearing in the browser tab
      2. Fixed single-character bold and italic text hanging across lines
      3. Fixed indented bold and italic text crossing lines
      4. Added reference-style links
      5. Added footnotes/endnotes
      6. Added citations
      7. Allowed code blocks within other formatting
      8. Code blocks can now contain diagram syntax without it becoming a diagram
      9. Optimized performance of documents with many blocks
      10. Updated Markdeep line hides the document until formatting succeeds or loading markdeep.js times out
      11. Added smart quotes for double quotation marks
      12. Fixed strict mode for Firefox
      13. Protected raw <code> blocks from processing
      14. Added automatic section links
      15. Added table and listing captions
      16. Added figure, table, and listing numbering and references
      17. Fixed single-letter italic words in lists
      18. Allowed lists to omit the leading blank line if the previous line ends in a colon or comma
      19. Allowed inline code to wrap around a line
      20. Stylized ~~~~code blocks appropriately for listings, while leaving ““ blocks unadorned
      21. Fixed URLs with underscores and tildes
      22. Added robust processing of lists with inconsistent indenting
      23. Added support for lists within definition lists
      24. Fixed definition lists with multiple :-indented lines
      25. Added support for multiple paragraphs in definition lists
      26. Added support for multiple paragraphs in regular lists
    • 2015-12-31 Version 0.07: Polish

      1. Fixed white dot decorations next to lines in diagrams
      2. Fixed floating images (broken in 0.06)
      3. Fixed diagonal up-left arrows not reaching boxes
      4. Added support for captionless images
      5. Added captions below images
      6. Added support for centered images
      7. Fixed processing of tables with short delimiters
      8. Fixed diagonals appearing inside curves with vertices in diagrams
      9. Allowed points vertically and horizontally adjacent to lines and points in diagrams
      10. Improved unicode line and box character appearance in diagrams
      11. Allowed leading space and shorter lines for Setext-style headers
      12. Added Unicode block character support for diagrams
      13. Enlarged Unicode hexagons to form tighter grids
      14. Text is now selectable in diagrams
      15. Added tiny grid examples to features.md.html
      16. Added dot grid examples to features.md.html
      17. Added Unicode examples to features.md.html
      18. Added beautification of a number followed by “degrees”
      19. Single linebreaks now allowed in italics, bold, and strikethrough
      20. Hid the document until formatting is complete, once it is known that the script is available
      21. Increased spacing between section numbers and titles
    • 2015-11-30 Version 0.06: Bug Fixes

      1. Improved arrowheads at points
      2. Improved arrowheads at boxes
      3. Improved processing of words with ‘o’ in boxes
      4. Script tag workaround for C++ template/Java generic syntax in code examples with capitalized classes
      5. Fixed blocks beginning at the top of the document
      6. Allow LaTeX expressions at the end of a sentence
      7. Relaxed whitespace rules for LaTeX expressions
      8. Fixed URLs in subtitles
      9. Centered diagrams by default
      10. Switched to https by default for Markdeep and Mathjax
    • 2015-11-10 Version 0.05: Beta

      1. Added named anchors to all sections
      2. Fixed $$ in code blocks
      3. Fixed header on the first line of a document
      4. Added table of contents generation
      5. Adjusted link styling
      6. Added markdeepOptions.detectMath
      7. Fixed ==> arrows in html mode
      8. Released implementation source code
    • 2015-10-27 Version 0.04: Optimization

      1. Reduced minified script size to 56k (v0.03 was 88k)
      2. Added notes about Unicode source
      3. En dash (--), em dash (---), and minus sign
      4. Transform x into × in cases such as “1920×1080”
      5. Fixed e-mail addresses in subtitles
      6. Fixed arrows in the middle of lines not appearing
      7. Removed borders around diagrams in the default stylesheet
      8. Made tables centered in the default stylesheet
      9. Added support for left floating diagrams
    • 2015-10-21 Version 0.03: Embedding Support

      1. Improved handling of underscore lines and parentheses in diagrams
      2. Added support for short verticals in diagrams, e.g., _.- -._
      3. Added support for hyperlinking of URLs containing ? and &
      4. Added CSS class support for <em> and <strong> tags to allow reinterpretation of em vs. em syntax.
      5. Fixed single quotes and dollar signs in fenced code blocks
    • 2015-10-18 Version 0.02: Conformance

      1. Reduced minified script size by 1k (to 83k)
      2. Added support for as a list bullet
      3. Explicitly protected script and style blocks (CommonMark)
      4. No longer allow spaces between flanking bold and italic delimiter runs and enclosed words (CommonMark)
      5. Switched to <em> and &emstrong> tags from explicit italic and bold ones
    • 2015-10-15 Version 0.01: Initial release

    Visit original content creator repository
    https://github.com/reelsense/markdeep

  • Delivery-and-Management-System-KiaOra

    Delivery-and-Management-System-KiaOra

    This is a java based web application with jsp, css frontend that was implemented for KiaOra Pvt.Ltd as a university project
    In this evolving world, most people are running a race against time, even the
    uncomplicated tasks like shopping have become hectic compared to early times.
    Furthermore, with this technological revolution people tend to find effortless ways to get
    their chores done in no time and some companies and organizations are no exception.
    They must step forward and evolve with modern technologies to cater their customers as
    well as their necessities in an orderly manner, particularly in a time like this where a
    pandemic situation has made the world a technology park. Therefore, by converting
    company’s downgraded manual tasks into automated business processes will diminish
    time consuming activities and workforce by making their daily functions less challenging
    and bringing forth convenience to their clients and thus gaining a favorable outcome as a
    company.
    KiaOra is a recently established, daily items delivering company, located in matale and
    Dambulla areas. With the expansion of their customer base, handling items, stocks and
    managing customers and employee’s payment details have become extremely difficult
    tasks. Consequently, an automated system came forward to ease the demand. This
    company is potentially focused on selling their items by having personal delivery system
    as well as seasonal promotions. They have suppliers who supply items such as bulbs, rice
    cookers, televisions etc. With regards to the personal delivery management system, the
    company’s delivery team take a route in particular area and sell their products to the
    people along the way. Whoever purchase the items must pay three quarters from the
    original price on the first day and will be given three months credit period to pay the
    remaining. The salesperson will insert order details of the customer and the order. Within
    that three months remaining payments will be updated and calculated by the system. In
    addition to that the company has seasonal promotions where they promote and sell their
    products in large scale by visiting places such as companies, targeting employees and
    offering them discounts as well. The credit period is as same as to the personal delivery
    customer. Furthermore, the company even sell items to number of shops as well, where
    the shop owner contacts the company and request the items directly. The details of the
    shops, owners, and items required to be stored in the system. Items repairing is another
    phase of this company. Whether it is an item purchased from them or not, it facilitates
    any repairing service to their customers. Overall, this brand-new system simply assists
    the owner of the company to follow any required information regarding his customers,
    employees, suppliers, payments, promotional sales, shops and owners, inventory details,
    monthly expenditure, and the profit in an effective manner.

    Contributors

    I.T.K.Kiridena

    R.R.J.K.V.Bandara Aramba

    W.M.K.H.B Wijethunga

    U.M.L.A.Nawarathne

    R.V Karunaratne

    M.E.J.D.Marasinghe

    P.M.P.P.Palihena

    U.D.S.Bandara

    S.D.J.Gunawardhana

    Visit original content creator repository
    https://github.com/IshiniKiridena/Delivery-and-Management-System-KiaOra

  • starter-architect

    Please Don’t Use

    Please use npm init remix instead of this starter repo to create a new Remix app.
    This repository was archived on April 29, 2021.

    Remix Starter for Architect (AWS CloudFormation)

    Welcome to Remix!

    This is a starter repo for using Remix with Architect (wrapper around AWS CloudFormation).

    Development

    When developing your app, you’ll need two terminal tabs, one to run Architect’s sandbox, and the other to run the Remix development server. In production, however, the Remix development server won’t be used because your assets will be built and shipped with the server.

    First, .npmrc.example to .npmrc and insert the license key you get from logging in to your dashboard at remix.run.

    Note: if this is a public repo, you’ll probably want to move the line with
    your key into ~/.npmrc to keep it private.

    Next, install all dependencies using npm:

    npm install

    Your @remix-run/* dependencies will come from the Remix package registry.

    Remix Development Server

    Once everything is installed, start the Remix asset server with the following command:

    npm run dev

    The dev server automatically rebuilds as your source files change.

    Architect Sandbox

    Architect recommends installing their CLI and the AWS sdk globally:

    $ npm i -g @architect/architect aws-sdk

    Now start the sandbox:

    $ arc sandbox

    You should now be able to visit http://localhost:3333.

    Deploying

    First, you’ll need to have the AWS CLI installed, here are the instructions. Then follow the Architect setup instructions: https://arc.codes/docs/en/guides/get-started/detailed-aws-setup.

    Now you’re ready to deploy. From the Remix http handler directory, build the app for production:

    $ npm run build

    And then from the root of the project, deploy with arc.

    $ arc deploy

    That’s it!

    Documentation

    Detailed documentation for Remix is available at remix.run.

    Visit original content creator repository
    https://github.com/remix-run/starter-architect

  • searching-twitter

    searching-twitter

    The purpose of this project was to utilize Twitter’s API to generate search results and log them to your preferred IDE’s console. In addition to other features, the program saves a record of each search to your local hard drive so you can utilize the data as you see fit.

    There is a possibility I’ll have time to edit the program to work by prompting a user to enter search results into your console and then making api calls via that. I’ll tack it on to a list of things I want to do.

    To use the program via Node JS, create a folder in your desired directory where the repo will live locally and clone the main branch into the directory.

    Create a separate .env file and use the .env_sample to format your .env file.

    Before performing a search, you will need to create a Twitter Developer account to generate an API Key, API Secret, Bearer Token, Access Token, and Access Token Secret for authentication with Twitter’s API.

    To sign up for a developer account:

    1. Log-in to Twitter and verify your email address. (Note that the email and phone number verification from your Twitter account may be needed to apply for a developer account, review on the Twitter help center: email address confirmation or add phone number.)

    2. Click sign up at developer.twitter.com to enter your developer account name, location and use case details

    3. Review and accept the developer agreement and submit

    4. Check your email to verify your developer account. Look for an email from developer-accounts@twitter.com that has the subject line: “Verify your Twitter Developer Account” Note: the developer-accounts@twitter.com email is not available for inbound requests.

    5. You should now have access to the Developer Portal to create a new App and ‘Project’ with Essential access (Essential access is all that’s required for this program currently).

    After you’ve created your developer account, you’ll need to generate the necessary keys and tokens as mentioned above. From the same developer.twitter.com URL, navigate to the Project dashboard and create a new app by clicking “Add App”.

    Add a name for the app (the name does not affect the program’s functionality) and after a unique name has been accepted by Twitter, you’ll receive the required authentication keys / tokens. Make sure to save these somewhere safe and secret before navigating off the web page or you’ll have to generate a new set.

    Create a .env file in your directory using the .env_sample file as a template and replace the placeholder text with your newly generated keys / tokens.

    Finally install all the required node modules using the below command in your CLI:

    npm install
    

    To generate your desired search results, navigate to the ‘searchParameters-node.js’ script and change the passed-arguments for the userInput function (don’t forget to save your JavaScript file afterwards). Now you should be ready to pull tweets from Twitter’s API!

    List of available CLI commands / program features are below.

    Searches Twitter for relevant tweets from the past 7 days:

    node searchTwitter-node.js
    

    Utilizes node Cron to schedule tweets to run n number of times. Please refer to the documentation below for more information on how Cron works:

    https://www.npmjs.com/package/node-cron

    You can also use the URL below to generate the required syntax for scheduling Cron to run your desired n number of times (make sure to update the ‘scheduleTwitterSearch-node.js’ and save your script):

    https://crontab.guru/

    node scheduleTwitterSearch-node.js
    

    Creates a summary document which compiles your past .txt searches into one document. It’s important to note that this function evaluates .txt files in your directory, so please run ‘node cleanDirectory.js’ before changing your search parameters to prevent different keyword search results from compiling into your summary file.

    node combineTweets-node.js
    

    Cleans up the file directory and moves recent searches into a folder using search parameters as a folder name.

    node cleanDirectory-node.js
    

    Visit original content creator repository
    https://github.com/izzy1090/searching-twitter

  • searching-twitter

    searching-twitter

    The purpose of this project was to utilize Twitter’s API to generate search results and log them to your preferred IDE’s console. In addition to other features, the program saves a record of each search to your local hard drive so you can utilize the data as you see fit.

    There is a possibility I’ll have time to edit the program to work by prompting a user to enter search results into your console and then making api calls via that. I’ll tack it on to a list of things I want to do.

    To use the program via Node JS, create a folder in your desired directory where the repo will live locally and clone the main branch into the directory.

    Create a separate .env file and use the .env_sample to format your .env file.

    Before performing a search, you will need to create a Twitter Developer account to generate an API Key, API Secret, Bearer Token, Access Token, and Access Token Secret for authentication with Twitter’s API.

    To sign up for a developer account:

    1. Log-in to Twitter and verify your email address. (Note that the email and phone number verification from your Twitter account may be needed to apply for a developer account, review on the Twitter help center: email address confirmation or add phone number.)

    2. Click sign up at developer.twitter.com to enter your developer account name, location and use case details

    3. Review and accept the developer agreement and submit

    4. Check your email to verify your developer account. Look for an email from developer-accounts@twitter.com that has the subject line: “Verify your Twitter Developer Account” Note: the developer-accounts@twitter.com email is not available for inbound requests.

    5. You should now have access to the Developer Portal to create a new App and ‘Project’ with Essential access (Essential access is all that’s required for this program currently).

    After you’ve created your developer account, you’ll need to generate the necessary keys and tokens as mentioned above. From the same developer.twitter.com URL, navigate to the Project dashboard and create a new app by clicking “Add App”.

    Add a name for the app (the name does not affect the program’s functionality) and after a unique name has been accepted by Twitter, you’ll receive the required authentication keys / tokens. Make sure to save these somewhere safe and secret before navigating off the web page or you’ll have to generate a new set.

    Create a .env file in your directory using the .env_sample file as a template and replace the placeholder text with your newly generated keys / tokens.

    Finally install all the required node modules using the below command in your CLI:

    npm install
    

    To generate your desired search results, navigate to the ‘searchParameters-node.js’ script and change the passed-arguments for the userInput function (don’t forget to save your JavaScript file afterwards). Now you should be ready to pull tweets from Twitter’s API!

    List of available CLI commands / program features are below.

    Searches Twitter for relevant tweets from the past 7 days:

    node searchTwitter-node.js
    

    Utilizes node Cron to schedule tweets to run n number of times. Please refer to the documentation below for more information on how Cron works:

    https://www.npmjs.com/package/node-cron

    You can also use the URL below to generate the required syntax for scheduling Cron to run your desired n number of times (make sure to update the ‘scheduleTwitterSearch-node.js’ and save your script):

    https://crontab.guru/

    node scheduleTwitterSearch-node.js
    

    Creates a summary document which compiles your past .txt searches into one document. It’s important to note that this function evaluates .txt files in your directory, so please run ‘node cleanDirectory.js’ before changing your search parameters to prevent different keyword search results from compiling into your summary file.

    node combineTweets-node.js
    

    Cleans up the file directory and moves recent searches into a folder using search parameters as a folder name.

    node cleanDirectory-node.js
    

    Visit original content creator repository
    https://github.com/izzy1090/searching-twitter

  • arithmo

    Arithmo

    A fast and simple-to-use library for math expressions processing

    Version: v1.0.0 License: GPL v3

    Contents

    Usage

    Here is an example of usage (for the full version see example/main.c file):

    const char* expression = "(23 - 4) * 3";
    
    // Creating an new arithmo instance:
    artm_calc_t* calc = artm_calc_init(5); // 5 is the approximate number of variables that will be used
    
    // Processing a mathematical expression:
    artm_result_t result = artm_calc_eval(calc, expression);
    
    // Saving the token to see exactly where the error is in the expression:
    const artm_token_t* token = &result.as.token;
    
    switch (result.status) {
      case ARTM_NULL_CALC:
        return printf("[ERROR] NULL_CALC\n");
      case ARTM_NULL_EXPR:
        return printf("[ERROR] NULL_EXPR\n");
      case ARTM_ALLOC_ERR:
        return printf("[ERROR] ALLOC_ERR\n");
      case ARTM_INV_TOKEN:
        return printf("[ERROR] INV_TOKEN -> '%.*s'\n", (int) token->size, token.target);
      case ARTM_UNDEF_VAR:
        return printf("[ERROR] UNDEF_VAR -> '%.*s'\n", (int) token->size, token.target);
      case ARTM_SUCCESS:
        return printf("[SUCCESS] %s = %g\n", expression, result.as.value);
    }
    
    // Destroying the instance:
    artm_calc_free(calc);

    After project building you can run this example as you can see here.

    Also, you can see xcalc – an real example of using Arithmo.

    Building and Installation

    Dependencies

    • C compiler (gcc, clang, etc…)
    • cmake (>= 3.17)

    These packages can usually be installed through your distributions package manager.

    Building the project

    To build the project, we first need to create a separate build directory:

    mkdir build
    

    Now that we’ve created our build directory (assuming it’s created in the project root), we can cd into it and run cmake and pass the parent directory path to it, which is where the CMakeLists.txt file is located:

    cd build
    cmake ..
    

    Once cmake is done generating makefiles, we can build the library by running make inside our build directory:

    make
    

    Running example

    ./example
    

    Installing

    To install the library run:

    sudo make install
    

    By default, the libraries and headers will be installed in /usr/local/lib and /usr/local/include directories.

    License

    Arithmo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. For more details, see LICENSE file.

    Contributing

    Contributions are welcome. If you have a feature request, or have found a bug, feel free to open a new issue. If you wish to contribute code, see CONTRIBUTING.md for more details.

    Visit original content creator repository https://github.com/vstan02/arithmo
  • todo-csharp-sql

    page_type languages products urlFragment name description
    sample
    azdeveloper
    aspx-csharp
    csharp
    bicep
    typescript
    html
    azure
    azure-sql-database
    azure-app-service
    azure-monitor
    azure-pipelines
    aspnet-core
    todo-csharp-sql
    React Web App with C# API and SQL Database on Azure
    A complete ToDo app with C# API and Azure SQL database for storage. Uses Azure Developer CLI (azd) to build, deploy, and monitor

    React Web App with C# API and SQL Database on Azure

    Open in GitHub Codespaces Open in Dev Container

    A blueprint for getting a React web app with a C# API and a SQL database running on Azure. The blueprint includes sample application code (a ToDo web app) which can be removed and replaced with your own application code. Add your own source code and leverage the Infrastructure as Code assets (written in Bicep) to get up and running quickly.

    Let’s jump in and get this up and running in Azure. When you are finished, you will have a fully functional web app deployed to the cloud. In later steps, you’ll see how to setup a pipeline and monitor the application.

    "Screenshot of deployed ToDo app"

    Screenshot of the deployed ToDo app

    Prerequisites

    This template will create infrastructure and deploy code to Azure. If you don’t have an Azure Subscription, you can sign up for a free account here. Make sure you have contributor role to the Azure subscription.

    The following prerequisites are required to use this application. Please ensure that you have them all installed locally.

    Quickstart

    To learn how to get started with any template, follow the steps in this quickstart with this template (Azure-Samples/todo-csharp-sql).

    This quickstart will show you how to authenticate on Azure, initialize using a template, provision infrastructure and deploy code on Azure via the following commands:

    # Log in to azd. Only required once per-install.
    azd auth login
    
    # First-time project setup. Initialize a project in the current directory, using this template.
    azd init --template Azure-Samples/todo-csharp-sql
    
    # Provision and deploy to Azure
    azd up

    Application Architecture

    This application utilizes the following Azure resources:

    Here’s a high level architecture diagram that illustrates these components. Notice that these are all contained within a single resource group, that will be created for you when you create the resources.

    "Application architecture diagram"

    Cost of provisioning and deploying this template

    This template provisions resources to an Azure subscription that you will select upon provisioning them. Refer to the Pricing calculator for Microsoft Azure to estimate the cost you might incur when this template is running on Azure and, if needed, update the included Azure resource definitions found in infra/main.bicep to suit your needs.

    Application Code

    This template is structured to follow the Azure Developer CLI. You can learn more about azd architecture in the official documentation.

    Next Steps

    At this point, you have a complete application deployed on Azure. But there is much more that the Azure Developer CLI can do. These next steps will introduce you to additional commands that will make creating applications on Azure much easier. Using the Azure Developer CLI, you can setup your pipelines, monitor your application, test and debug locally.

    Note: Needs to manually install setup-azd extension for Azure DevOps (azdo).

    • azd pipeline config – to configure a CI/CD pipeline (using GitHub Actions or Azure DevOps) to deploy your application whenever code is pushed to the main branch.

    • azd monitor – to monitor the application and quickly navigate to the various Application Insights dashboards (e.g. overview, live metrics, logs)

    • Run and Debug Locally – using Visual Studio Code and the Azure Developer CLI extension

    • azd down – to delete all the Azure resources created with this template

    • Enable optional features, like APIM – for enhanced backend API protection and observability

    Additional azd commands

    The Azure Developer CLI includes many other commands to help with your Azure development experience. You can view these commands at the terminal by running azd help. You can also view the full list of commands on our Azure Developer CLI command page.

    Security

    Roles

    This template creates a managed identity for your app inside your Azure Active Directory tenant, and it is used to authenticate your app with Azure and other services that support Azure AD authentication like Key Vault via access policies. You will see principalId referenced in the infrastructure as code files, that refers to the id of the currently logged in Azure Developer CLI user, which will be granted access policies and permissions to run the application locally. To view your managed identity in the Azure Portal, follow these steps.

    The template will also create a dedicated Azure SQL user for the application and store its credentials in a KeyVault (see below). The application user’s access is restricted to the ToDo database only; a separate administrator account is set up for managing the whole Azure SQL instance.

    Key Vault

    This template uses Azure Key Vault to securely store your Azure SQL Database credentials and the connection string used by the application to interact with the database. Key Vault is a cloud service for securely storing and accessing secrets (API keys, passwords, certificates, cryptographic keys) and makes it simple to give other Azure services access to them. As you continue developing your solution, you may add as many secrets to your Key Vault as you require.

    Reporting Issues and Feedback

    If you have any feature requests, issues, or areas for improvement, please file an issue. To keep up-to-date, ask questions, or share suggestions, join our GitHub Discussions. You may also contact us via AzDevTeam@microsoft.com.

    Visit original content creator repository https://github.com/Azure-Samples/todo-csharp-sql
  • byteskode-android-push

    byteskode-android-push

    byteskode push – Android FCM library

    Installation

    Add https://jitpack.io to your build.gradle with:

    allprojects {
        repositories {
            maven { url "https://jitpack.io" }
        }
    }

    add byteskode-android-push dependency into your project

    dependencies {
        compile 'com.github.byteskode:byteskode-android-push:v0.3.0'
    }

    Usage

    Initialize byteskode-android-push

    public class SampleApp extends Application{
    
        @Override
        public void onCreate() {
            super.onCreate();
    
            //initialize push
            Push.initialize(<context>, <apiBaseUrl>, <apiAuthorizationToken>);
        }
    
    }

    In activity start listen for the foreground push message

    public class MainActivity extends PushCompactActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
        }
    
        @Override
        protected void onResume() {
            super.onResume();
        }
    
        @Override
        protected void onDestroy() {
            super.onDestroy();
        }
    
        @Override
        public void onMessage(RemoteMessage remoteMessage) {
            ...
        }
    
         @Override
         public void onRegistrationTokenRefreshed(Device device) {
            ....
         }
    
         @Override
         public void onRegistrationTokenError(String error) {
            ...
         }
         
         @Override
          public void onDeviceSynced(Device device) {
            ...
          }
    }

    Android API

    Force Device Sync with Extra Details

    To force sync application specific extra details you may call push.sync(<extraKey>, <extraValue>) or push.sync(mapOfExtras)
    which will force syncing the device details to your backend api.

    All extras will be send under extras field of the device details sent to the server.

    Example

    { 
      extras: { 
          phone: '255714999999' 
       },
      instanceId: <firebaseInstanceId>,
      registrationToken: <firebasePushRegistrationToken>,
      topics: [], //list of topic device subscribe to
      uuid: <uniquePseudoId> 
    }

    API Server Implementation

    API Server endpoint must implemnt device REST aware resource and support both POST and PUT request.

    Authorization header is set with the value Bearer <apiAuthorizationToken> on every request sent.

    The structure of the information synced to the API end-point is as below:

    {
        instanceId: String, //FCM instance id
        registrationToken: String, //FCM devic registration token
        topics: [String], //FCM device topic
        uuid: String, // Generated device pseudocode
        info:{ //device information
           tags: String,
           model: String,
           hardware: String,
           display: String,
           board: String,
           type: String,
           product: String,
           fingerprint: String,
           manufacturer: String,
           device: String,
           brand: String,
           sdk: String,
           serial: String 
        },
        extras:{ //application specific extra details about the installation
            
        }
    }

    Test

    ./gradlew test

    Contribute

    It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas.
    Do not forget to add a bit of test(s) of what value you adding.

    TODO

    • do lazy initialization on Push.initialize() and move heavy initialization on getInstance()
    • drop async task and use intent service with localbroadcasts
    • update Device to add phone, email & user details
    • expose ability to get device from push instance
    • add ability to update device from push instance
    • add ability to set extra using key-value
    • add ability to set more info using key-value
    • rename device to installation
    • should allow send abitrary command on sync
    • sync using device uuid that push registration token
    • add api implementation on top of nodejs and mongodb

    License

    (The MIT License)

    Copyright (c) 2016 lykmapipo, byteskode Group && Contributors

    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
    ‘Software’), to deal in the Software without restriction, including
    without limitation the rights to use, copy, modify, merge, publish,
    distribute, sublicense, and/or sell copies of the Software, and to
    permit persons to whom the Software is furnished to do so, subject to
    the following conditions:

    The above copyright notice and this permission notice shall be
    included in all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
    TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    Visit original content creator repository
    https://github.com/byteskode/byteskode-android-push