Blog

  • dart_extensions

    What New (2.2.4)

    • Sliver extensions

    Why Method Extensions? When you’re using someone else’s API or when you implement a library that’s widely used, it’s often impractical or impossible to change the API. But you might still want to add some functionality.

    let me know if you want something specific or you found a bug at bar.idan@gmail.com

    Let get started 💪🏻

    1. Go to pubspec.yaml
    2. add a dart_extensions and replace [version] with the latest version:
    dependencies:  
     dart_extensions: ^[version]
    1. click the packages get button or flutter pub get

    Responsive UI

    Very common way to calculate size in percentage is using the MediaQuery like so:

    MediaQuery.of(context).size.width * 0.1

    Flatten a nested Map into a single level map

    response.flatJson({
      'key1': {'keyA': 'valueI'},
      'key2': {'keyB': 'valueII'},
      'key3': {
        'a': {
          'b': {'c': 2}
        }
      }
    });
    
    The result you can also specify max depth, its the maximum number of nested objects to flatten.

    // { // ‘key1.keyA’: ‘valueI’, // ‘key2.keyB’: ‘valueII’, // ‘key3.a.b.c’: 2 // };

    Instead of the boilerplate we can use this awesome extension and get the same results.

    Wrap your Application with:

    ResponsiveApp(
          builder: (BuildContext context, Orientation orientation, DeviceType deviceType) {
            return YourAppWidget()
    )
    AnimatedList(
                  key: chatListKey,
                  reverse: true,
                  padding: EdgeInsets.only(top: 10.textSizeResponsive),
                  shrinkWrap: true,

    Also the text should be responsive, no problem

    Text(
      'Note added by ${message.from ?? ''}',
      style: avanirBook.copyWith(fontSize: 8.responsiveText),
    ),

    Iterable Extensions

    .any()

    Returns true if at least one element matches the given predicate.

    final users = [User(22, "Kasey"), User(23, "Jadn")]; 
    users.any((u) => u.name == 'Kasey') // true

    .groupBy()

    Groups the elements in values by the value returned by key.

    final users = [User(22, "Kasey"), User(23, "Jadn"), User(22, "Rene"), User(32, "Aden")]; 
    
    users.groupBy((u) => u.age); 

    Sort the users by age:

    {  
      22: [User:22, Kasey, User:22, Rene], 
      23: [User:23, Jadn], 
      32: [User:32, Aden]
    }

    .sortBy()

    Sorts elements in the array in-place according to natural sort order of the value returned by specified selector function.

    final users = [User(22, "Kasey"), User(16, "Roni"), User(23, "Jadn")]; 
    users.sortBy((u) => u.age) ///  [User(16, "Roni"), [User(22, "Kasey"), User(23, "Jadn")]

    .find()

    Returns the first element matching the given predicate, or null if element wasn’t found.

    final users = [User(22, "Kasey"), User(23, "Jadn"), User(22, "Rene"), User(32, "Aden")]; 
    
    users.find((u) => u.name == "Rene") // User(22, "Rene")

    .chunks()

    Splits the Iterable into chunks of the specified size

    [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].chunks(3)) 

    result

    ([1, 2, 3], [4, 5, 6], [7, 8, 9], [10])

    .filter()

    Returns a list containing only elements matching the given predicate, the return type will be List, unlike the where operator that return Iterator, also it filters null.

    final users = [User(22, "Kasey"), User(23, "Jadn"), User(22, "Rene"), User(32, "Aden")]; 
    final filtered = users.filter((u) => u.name == "Kasey"); // [User(22, "Kasey")] <- Type List<User>
    
    final listWithNull = [null, User(23, "Jadn"), User(22, "Rene"), User(32, "Aden")];
    final filtered = listWithNull.filter((u) => u.name == "Jadn"); // [User(23, "Jadn")]

    .intersect()

    Returns a set containing all elements that are contained by both this set and the specified collection.

    Set.from([1, 2, 3, 4]).intersect(Set.from([3, 4, 5, 6]) // 1,2,3,4,5,6

    .filterNot()

    Returns a list containing only not the elements matching the given predicate, the return type will be List, unlike the where operator that return Iterator, also it filters null.

    final users = [User(22, "Kasey"), User(23, "Jadn"), User(22, "Rene"), User(32, "Aden")]; 
    final filtered = users.filterNot((u) => u.name == "Kasey"); // [User(23, "Jadn"), User(22, "Rene"), User(32, "Aden")] <- Type List<User>
    
    final listWithNull = [null, User(23, "Jadn"), User(22, "Rene"), User(32, "Aden")];
    final filtered = listWithNull.filterNot((u) => u.name == "Jadn"); // [User(22, "Rene"), User(32, "Aden")]

    .takeOnly()

    Returns a list containing first [n] elements.

    [1, 2, 3, 4].takeOnly(1) // [1]

    .drop()

    Returns a list containing all elements except first [n] elements.

    [1, 2, 3, 4].drop(1) // [2, 3, 4]

    .forEachIndexed()

    Performs the given action on each element on iterable, providing sequential index with the element.

    ["red","green","blue"].forEachIndexed((item, index) { 
    	print("$item, $index"); 
    }); // 0: red // 1: green // 2: blue```  

    .sortedDescending()

    Returns a new list with all elements sorted according to descending natural sort order.

    var list = [1,2,3,4,5];  
    final descendingList = list.sortedDescending();  
    print(descendingList); // [5, 4, 3, 2, 1]

    .count()

    Return a number of the existing elements by a specific predicate

    final users = [User(33, "Miki"), User(45, "Anna"), User(19, "Amit")];  
      
    final aboveAgeTwenty = users.count((user) => user.age > 20);  
    print(aboveAgeTwenty); // 2

    .associate()

    Creates a Map instance in which the keys and values are computed from the iterable.

    final users = [User(33, "Miki"), User(45, "Anna"), User(19, "Amit")];  
    
    users.associate((k) => k.name, (e) => e.age) // 'Miki': 33, 'Anna': 45, 'Amit': 19}

    .concatWithMultipleList()

    Return a list concatenates the output of the current list and multiple iterables.

      final listOfLists = [
            [5, 6, 7],
            [8, 9, 10]
          ];
      [1, 2, 3, 4].concatWithMultipleList(listOfLists); 
      
      // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

    .distinctBy()

    Returns a list containing only the elements from given collection having distinct keys.

    // example 1
    final users = ["Zack", "Ian", "Ronit"];  
    users.distinctBy((u) => u.toLowerCase().startsWith("z")); // Zack 
    
    // example 2
    final users = [User(11, 'idan'), User(12, 'ronit'), User(11, 'asaf')];
    	
    final dist = users.distinctBy((u) => u.age);    
    dist.forEach((u) => print(u.age)); //  11, 12

    .zip()

    Zip is used to combine multiple iterables into a single list that contains the combination of them two.

    final soldThisMonth = [Motorcycle(2020, 'BMW R1200GS'), Motorcycle(1967, 'Honda GoldWing')];
    final soldLastMonth = [Motorcycle(2014, 'Honda Transalp'), Motorcycle(2019, 'Ducati Multistrada')];    
      
    final sales = soldThisMonth.zip(soldLastMonth).toList();  
      				
    print(sales); // [
      [brand: BMW R1200GS year: 2020, brand: Honda Transalp year: 2014], // first pair from this month and last
      [brand: Honda GoldWing year: 1967, brand: Ducati Multistrada year: 2019] // second pair from last month 
    ]

    See iterable.dart for more examples.

    Flutter Extensions

    Context extensions

    Are you not tired from typing MediaQuery.of(context).size... to get height or width? here’s a cool extension

      context.mq  // returns the MediaQuery
      context isLandscape // returns if Orientation is landscape
    context.sizePx // returns same as MediaQuery.of(context).size
    context.widthPx // returns same as MediaQuery.of(context).size.width
    context.heightPx // returns same as MediaQuery.of(context).height

    Text Extensions

    final text = Text('hello')
         .bold()
         .fontSize(25)
         .italic();

    List Extensions

        final someWidgetList = [
          Text('hello'),
          Text('world'),
        ].toColumnWidget();  // toRowWidget(), toStackWidget()

    Widget extensions

    So now we can just add round corners, shadows, align, and added gestures to our Widgets without the crazy water-fall effect. awesome! That’s just the tip of the iceberg, expect to see very cool stuff soon.

    class Home extends StatefulWidget {
      @override
      _HomeState createState() => _HomeState();
    }
    
    class _HomeState extends State<Home> {
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: Container(
            child: Stack(
              children: <Widget>[
                Container(
                  height: 100,
                  width: 100,
                )   .withRoundCorners(backgroundColor: Colors.grey)
                    .withShadow()
                    .alignAtCenter()
                    .toCenter()
                    .withTooltip('just a tooltip')
                    .paddingOnly(left: 10)
                    .paddingAll(20)
                    .onTap(() => print('tap'))
                    .onLongPress(() => print('long press'))
              ],
            ),
          ),
        );
      }
    }

    Navigation

    We can navigate from every widget by calling these methods

        navigateTo(route: MaterialPageRoute(builder: (c) => Login()));
        navigateByRouteName(Routes.home, );
        final result = navigateBack();

    Http Extensions

    .httpGet()

    Sends an HTTP GET request with the given headers to the given URL

    final json = await "https://jsonplaceholder.typicode.com/posts".httpGet();

    result:

    [
      {
        "userId": 1,
        "id": 1,
        "title": "sunt aut facere",
        "body": "quia et suscipit"
      },
      {
        "userId": 1,
        "id": 2,
        "title": "qui est esse",
        "body": "dolor beatae ea dolores neque"
      },
    ]

    usage with then:

    "https://jsonplaceholder.typicode.com/posts".httpGet().then((result) {
              print(result);
           }).catchError((e) => print(e));

    .httpPost()

    Sends an HTTP POST request with the given headers and body to the given URL which can be a [Uri] or a [String].

    String json = '{"title": "Hello", "body": "body text", "userId": 1}';
    final json = await "https://jsonplaceholder.typicode.com/posts".httpPost(json);

    for more examples (put, delete) See http.dart

    Range Extensions

    .until()

    Returns a sequence of integer, starting from the current number until the [end] number. [step] is optional, it will step number if given

    for(final num in 1.until(10)) {
      numbers.add(num); 
    }

    result

    [1, 2, 3, 4, 5, 6, 7, 8, 9]

    with step:

    for(final num in 1.until(10, step: 2)) {
      numbers.add(num); 
    }

    result

    [1, 3, 5, 7, 9]

    String Extensions

    .asBool()

    Returns true if this string is any of these values: “true”, “yes”, “1”, or if the string is a number and greater than 0, false if less than 1. This is also case insensitive.

    'true'.asBool  // true
    'True'.asBool  // true
    'false'.asBool //  false
    'False'.asBool //  false
    'yes'.asBool   // true
    'YES'.asBool   // true
    'no'.asBool    // false
    'NO'.asBool    // false

    .insert()

    Returns a new string in which a specified string is inserted at a specified index position in this instance.

    'test'.insert(1, 't') // 'ttest'
    '123456890'.insert(6, '7') // '1234567890'
    'dart cool'.insert(4, ' is') // 'dart is cool'

    .isNullOrWhiteSpace()

    Indicates whether a specified string is null, empty, or consists only of white-space characters.

    'test'.isNullOrWhiteSpace // false
    '   '.isNullOrWhiteSpace, // true
    null.isNullOrWhiteSpace, // true
    '  te  st  '.isNullOrWhiteSpace // false

    .replaceAfter()

    Replace part of string after the first occurrence of given delimiter.

    print("myemail@".replaceAfter("@", "gmail.com")); // myemail@gmail.com 

    .replaceBefore()

    Replace part of string before the first occurrence of given delimiter.

    print('@domain.com'.replaceBefore('@', "name")); // "name@domain.com"

    .anyChar()

    Returns true if at least one element matches the given predicate

    'test'.anyChar((c) => c == 't'); // true;
    'test'.anyChar((c) => c == 'd'); // false;

    .ifEmpty()

    If the string is empty perform an action.

    "".ifEmpty(() => print("do any action here")); // do any action here

    .toDoubleOrNull()

    Parses the string as an integer or returns null if it is not a number.

    var number = '12345'.toDoubleOrNull(); // 12345  
    var notANumber = '123-45'.toDoubleOrNull(); // null  

    .limitFromEnd()

    Limit the string to a maximum length, taking from the end of the string.

    var longString = "0123456789";
    var noMoreThanThree = longString.limitFromEnd(3); // "789"

    .limitFromStart()

    Limit the string to a maximum length, taking from the start of the string.

    var longString = "0123456789";
    var noMoreThanThree = longString.limitFromStart(3); // "012"

    int Extensions

    .inRangeOf()

    Return the min if this number is smaller then minimum Return the max if this number is bigger the the maximum Return this number if it’s between the range

    1.inRangeOf(0, 3) // 1 number in range so will return the number
    2.inRangeOf(3, 4) // 3 number is smaller then the range so will return min
    5.inRangeOf(3, 4) // 4 number is bigger then the range so will return max

    Flutter Extensions Full List

    Flutter

    • Tooltip
    • algin
    • center
    • container
    • padding
    • navigation
    • Context
    • Text
    • List<Widget>
    • Icon

    Http Extensions

    • httpGet
    • httpPost
    • httpPut
    • httpDelete

    Iterables Extensions

    • sortBy
    • toMutableSet
    • intersect
    • groupBy
    • find
    • filter
    • filterNot
    • isEmptyOrNull
    • chunks
    • zip
    • half
    • takeOnly
    • drop
    • firstHalf
    • secondHalf
    • swap
    • getRandom
    • firstOrNull
    • firstOrNullWhere
    • firstOrDefault
    • lastOrNull
    • lastOrDefault
    • forEachIndexed
    • sortedDescending
    • containsAll
    • count
    • distinctBy
    • subtract
    • concatWithSingleList
    • concatWithMultipleList
    • associate

    Range Extensions

    • until

    Strings Extensions

    • validateEmail
    • removeSurrounding
    • isNullOrEmpty
    • replaceAfter
    • replaceBefore
    • orEmpty
    • ifEmpty
    • lastIndex
    • printThis
    • equalsIgnoreCase
    • toDoubleOrNull
    • toIntOrNull
    • anyChar
    • removeAllWhiteSpace
    • isNotBlank
    • toCharArray
    • insert
    • isNullOrWhiteSpace
    • asBool

    DateTime Extensions

    • toMilliseconds
    • toSeconds
    • toMinutes
    • toHours
    • toDays
    • isToday
    • addOrRemoveYears
    • addOrRemoveMonth
    • addOrRemoveDay
    • addOrRemoveMinutes
    • addOrRemoveSeconds
    • startOfDay
    • startOfMonth
    • startOfYear
    • operator to add dates
    • operator to subtract dates
    • tomorrow
    • yesterday
    • min
    • max
    • isLeapYear
    • limitFromEnd
    • limitFromStart

    Integers Extensions

    • inRangeOf
    • absolute
    • isEven
    • isOdd
    • isPositive
    • isNegative
    • tenth
    • fourth
    • third
    • half
    • doubled
    • tripled
    • quadrupled
    • squared
    • asBool

    Contributing

    If you have read up till here, then 🎉🎉🎉. There are couple of ways in which you can contribute to the growing community of dart_extensions.dart.

    • Propose any feature, enhancement
    • Report a bug
    • Fix a bug
    • Participate in a discussion and help in decision making
    • Write and improve some documentation. Documentation is super critical and its importance cannot be overstated!
    • Send in a Pull Request 🙂

    Contributors ✨


    Idan Ayalon

    💻 📖 👀

    Xamantra

    💻 📖 👀

    License

    Copyright 2020 Idan Ayalon
      
    Licensed under the Apache License, Version 2.0 (the "License");  
    you may not use this file except in compliance with the License.  
    You may obtain a copy of the License at  
      
     http://www.apache.org/licenses/LICENSE-2.0  
    Unless required by applicable law or agreed to in writing, software  
    distributed under the License is distributed on an "AS IS" BASIS,  
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
    See the License for the specific language governing permissions and  
    limitations under the License.  
    
    Visit original content creator repository https://github.com/droididan/dart_extensions
  • jasper2

    Jasper2

    Build Status Ruby Jekyll

    This is a full-featured port of Ghost’s default theme Casper v2.1.9 for Jekyll / GitHub Pages.

    Live Demo

    Ghost’s Casper // Jasper2

    home page

    Features

    • Out of the box support for multiple authors (via _data/authors.yml)
    • Full author information including: picture, bio, website, twitter, facebook, etc.
    • Tag description(s) and personalised covers (via _data/tags.yml)
    • Related posts view at the bottom of each post
    • All Ghost default pages: Author page(s), Tag page(s), About page(s), 404, etc.
    • Pagination (infinite scrolling or standard pagination, i.e. posts across multiple pages)
    • Atom Feeds by Jekyll-feed
    • Toggleable subscribe button (requires an external service)
    • Code Syntax Highlight with highlight.js
    • Support for Google Analytics tracking
    • Support for Disqus comments (not Ghost standard)

    Getting Started

    Deployment

    There are several alternatives to building and deploying the site:

    1. build the site with GitHub Actions which pushes the resulting files (the contents of _site/ or ../jasper2-pages/) to the gh-pages branch. This is the approach that is currently used. See jekyll_build.yml for more details.

    2. generate the site locally (more details below) and push the resulting HTML to a Github repository, that GitHub Pages then host;

    3. build the site with travis-ci (with goodies from jekyll-travis) automatically pushing the generated HTML files to a gh-pages branch.

    4. deploy the static website with Jekyll-compatible hosters, such as https://www.netlify.com/, that allow for deployment from the Github repo and publish the website using CDNs. Netlify has a free starter offer.

    For option 2) simply clone this repository (master branch), and then run bundle exec jekyll serve inside the directory. Upload the resulting _site/ (or ../jasper2-pages/) contents to your repository (master branch if uploading as your personal page (e.g. username.github.io) or gh-pages branch if uploading as a project page (as for the demo).

    For option 3) you will need to set up travis-ci for your personal fork. Briefly all you need then is to change your details in _config.yml so that you can push to your github repo. You will also need to generate a secure key to add to your .travis.yml (you can find more info on how to do it in that file). Also make sure you read the documentation from jekyll-travis. This approach has clear advantages in that you simply push your file changes to GitHub and all the HTML files are generated for you and pushed to gh-pages. Also you get to know if everything is still fine with your site builds. Don’t hesitate to contact me if you still have any issues (see below about issue tracking).

    Author Pages

    In order to properly generate author pages you need to rename the field author in the front matter of every post to match that of your each author’s username as defined in the _data/authors.yml file. With the latest update, multiple author blogs are now supported out of the box.

    Compiling Styles

    Following on the way Casper styles are compiled as described here:

    Jasper2 styles are compiled using Gulp/PostCSS to polyfill future CSS spec. You’ll need Node and Gulp installed globally. After that, from the theme’s root directory:

    $ npm install
    $ gulp

    Now you can edit /assets/css/ files, which will be compiled to /assets/built/ automatically.

    Issues and Contributing

    This install builds well with Ruby v2.6.3 and Jekyll v3.9.0. If you run into any problems please log them on the issue tracker.

    Feel free pull-request your patches and fixes.

    Thanks

    Many thanks to the Ghost team for all the design work. Also many thanks to all contributors, that help keeping the project alive and updated 😄

    Copyright & License

    Same licence as the one provided by Ghost’s team. See Casper’s theme license.

    Copyright (C) 2015-2021 – Released under the MIT License.

    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/jekyllt/jasper2
  • jasper2

    Jasper2

    Build Status Ruby Jekyll

    This is a full-featured port of Ghost’s default theme Casper v2.1.9 for Jekyll / GitHub Pages.

    Live Demo

    Ghost’s Casper // Jasper2

    home page

    Features

    • Out of the box support for multiple authors (via _data/authors.yml)
    • Full author information including: picture, bio, website, twitter, facebook, etc.
    • Tag description(s) and personalised covers (via _data/tags.yml)
    • Related posts view at the bottom of each post
    • All Ghost default pages: Author page(s), Tag page(s), About page(s), 404, etc.
    • Pagination (infinite scrolling or standard pagination, i.e. posts across multiple pages)
    • Atom Feeds by Jekyll-feed
    • Toggleable subscribe button (requires an external service)
    • Code Syntax Highlight with highlight.js
    • Support for Google Analytics tracking
    • Support for Disqus comments (not Ghost standard)

    Getting Started

    Deployment

    There are several alternatives to building and deploying the site:

    1. build the site with GitHub Actions which pushes the resulting files (the contents of _site/ or ../jasper2-pages/) to the gh-pages branch. This is the approach that is currently used. See jekyll_build.yml for more details.

    2. generate the site locally (more details below) and push the resulting HTML to a Github repository, that GitHub Pages then host;

    3. build the site with travis-ci (with goodies from jekyll-travis) automatically pushing the generated HTML files to a gh-pages branch.

    4. deploy the static website with Jekyll-compatible hosters, such as https://www.netlify.com/, that allow for deployment from the Github repo and publish the website using CDNs. Netlify has a free starter offer.

    For option 2) simply clone this repository (master branch), and then run bundle exec jekyll serve inside the directory. Upload the resulting _site/ (or ../jasper2-pages/) contents to your repository (master branch if uploading as your personal page (e.g. username.github.io) or gh-pages branch if uploading as a project page (as for the demo).

    For option 3) you will need to set up travis-ci for your personal fork. Briefly all you need then is to change your details in _config.yml so that you can push to your github repo. You will also need to generate a secure key to add to your .travis.yml (you can find more info on how to do it in that file). Also make sure you read the documentation from jekyll-travis. This approach has clear advantages in that you simply push your file changes to GitHub and all the HTML files are generated for you and pushed to gh-pages. Also you get to know if everything is still fine with your site builds. Don’t hesitate to contact me if you still have any issues (see below about issue tracking).

    Author Pages

    In order to properly generate author pages you need to rename the field author in the front matter of every post to match that of your each author’s username as defined in the _data/authors.yml file. With the latest update, multiple author blogs are now supported out of the box.

    Compiling Styles

    Following on the way Casper styles are compiled as described here:

    Jasper2 styles are compiled using Gulp/PostCSS to polyfill future CSS spec. You’ll need Node and Gulp installed globally. After that, from the theme’s root directory:

    $ npm install
    $ gulp

    Now you can edit /assets/css/ files, which will be compiled to /assets/built/ automatically.

    Issues and Contributing

    This install builds well with Ruby v2.6.3 and Jekyll v3.9.0. If you run into any problems please log them on the issue tracker.

    Feel free pull-request your patches and fixes.

    Thanks

    Many thanks to the Ghost team for all the design work. Also many thanks to all contributors, that help keeping the project alive and updated 😄

    Copyright & License

    Same licence as the one provided by Ghost’s team. See Casper’s theme license.

    Copyright (C) 2015-2021 – Released under the MIT License.

    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/jekyllt/jasper2
  • MaA_Lab_1A

    Measurements and Analysis Projected Experiment 1A: Thermistor DAQ

    This repository contains the material and codebase for the projected thermistor DAQ teaching experiment.

    Currently in this repo is the codebase only; the lab overview has not been added yet. It contains these files:

    MaA_Lab_1A_DAQ.ino
    ├── MaA_Lab_1A_DAQ.ino
    ├── sketch.yaml
    ├── src
    │   ├── pycache
    │   │   └── daq.cpython-312.pyc
    │   ├── daq.py
    │   └── gui.py
    └── thermistor_daq.py

    MaA_Lab_1A_DAQ.ino and sketch.yaml are the files relating to the Arduino sketch. This is the file used by the CLI to install the .ino sketch onto the board. Note that the default port and FQBN can be changed either by hand, or the YAML can be deleted and regenerated using the CLI.

    The src directory contains the source code for the ThermaLens Python application.

    THe thermistor_daq.py is a standalone script that uses the pySerial Library to read the values directly from the Arduino. Note that it uses the USB serial, so ensure that the CLI or the IDE is not reading from the Arduino at the same time.

    Currently, there will be updates to the repo, including the full lab handout, a list of dependencies, and gradual updates to the ThermaLens GUI.

    Visit original content creator repository
    https://github.com/jeanochs/MaA_Lab_1A

  • the100

    THE 100, the fastest 3D Printer based on a printed frame.

    • It does Speedboat in less than 6 minutes and is capable of doing high quality prints in 1/10th of the time a Ender 3 would need.
    • By the time releasing, The 100 is at the 26th rank of the leaderboard of the fastest printers in the world and it’s the fastest one that uses a 3d printed frame.
    • And the best thing, this printer 100% open source. Which means if you like this printer and you like to build one by own, you find all resources needed to do this in this repository

    Links

    Print Settings

    To print the STL files, a 3D printer with a print bed of at least 230x230mm is required. I’ve printed all parts out of PLA. If you plan to print ABS/ASA on the printer i would suggest to print the print bed out of a more temprature resistant material.

    For all STL Parts exept the print bed i’ve used the following settings:

    • 0.25 Layer height
    • 0.5 Line width
    • 3 Top layers
    • 3 Bottom layers
    • 3 Walls
    • 25% Infill
    • Grid Infill Pattern

    For the print bed:

    • 30% Infill

    The infill of the print bed needs to be slightly higher to move the center of gravity to where the lead screws are attached. This is needed to stop binding on the Z-Axis.

    Specifications

    • Printing Technology: FDM
    • Build Volume: 165x165x150mm
    • Maximum Printing Speed: 400mm/s
    • Maximum Acceleration: 100.000mm/s²
    • Layer Height: 0.1-0.35mm
    • Extruder: BMG Bowden Extruder
    • Filament Diameter: 1.75mm
    • Nozzle Diameter: 0.4 (swappable)
    • Maximum Nozzle Temperature: 300°C
    • Maximum Heatbed Temperature: 110°C
    • Leveling Mode: manual
    • File Transfer: USB Drive, WIFI
    • Rated Power: 350W
    • Supported Filaments: PLA, PETG

    Builds by the Community

    img

    Visit original content creator repository https://github.com/MSzturc/the100
  • MyYeelightLAN

    My Yeelight LAN

    MIT license Release Downloads

    My Yeelight LAN is an App to remote control your Yeelight Device in Local Area Network (LAN) which doesn’t require any internet connectivity.

    Developed By: Asswad Sarker Nomaan

    Privacy Policy

    Latest Release: Download

    Get it on Google Play

    Features

    • Search & Connect to Yeelight Device over LAN
    • Stores recent device to connect faster
    • Control Device Power on/off of Yeelight Device
    • Control Brightness of Yeelight Device
    • Change Color, Color Temperature, Hue, Saturation of Yeelight Device (Supported Models only)
    • Change Smoothness Value
    • Control Power from Quick Settings Tile in Notification Bar
    • Control Power & Brightness from Home Screen Widget

    Screenshots

    HomeScreen HomeSearch ControlScreen DeviceInfo ColorPicker BrightnessInput HomeScreenRecent Menu DeleteRecent Help About CheckUpdates UpdateResult QuickSettings WidgetAdd Widget

    License

    Copyright (c) 2020 Asswad Sarker Nomaan
    
    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/asnbd/MyYeelightLAN
  • dram

    Decentralized Remotely Accessed Memory

    Ever joked about downloading more RAM? 🤣 WELL NOW YOU CAN MOTHER FUCKER!

    Here’s the deal: we use a tmpfs on the donor machine to pretend a chunk of its RAM is a hard drive. Then, we get fancy with NFS to share this faux-drive over the network 🌐. On the recipient’s side, we mount this networked RAM-drive and set up a swap file.

    Go insane with it & donate RAM from multiple machines…decentralize the RAM of a single server all over the planet! Latency is the devil 😈 LOL

    The make-it-happen Magic

    Setup RAM Donator

    1. Create an entry in /etc/fstab to create the RAM partition:

    tmpfs /mnt/ramote_send tmpfs nodev,nosuid,noexec,nodiratime,size=1G 0 0

    Note: Change 1G to the amount of RAM you want to donate.

    1. Create the RAM partition directory & mount it:

    mkdir -p /mnt/ramote_send
    mount /mnt/ramote_send
    1. Download & install an NFS server daemon of your choice:
    apt-get install nfs-kernel-server
    1. Configure & start the NFS server:
    • Edit your /etc/exports file:

    /mnt/ramote_send <client-ip>(rw,sync,no_root_squash,no_subtree_check)

    • Start & enable the service:

    systemctl start nfs-kernel-server
    systemctl enable nfs-kernel-server

    Setup RAM Receiver

    1. Create a directory & mount the NFS:

    mkdir -p /mnt/ramote_recv
    mount <nfs-server-ip>:/mnt/ramote_send /mnt/ramote_recv
    1. Create & enable a swap file inside the NFS directory:

    dd if=/dev/zero of=/mnt/ramote_recv/swapfile bs=1M count=1024
    chmod 600 /mnt/ramote_recv/swapfile
    mkswap /mnt/ramote_recv/swapfile
    swapon /mnt/ramote_recv/swapfile

    Note: Change the swap file size according to what you allocated on the donator.

    1. Create an entry in /etc/fstab to for the NFS mount & the swap file:

    <nfs-server-ip>:/mnt/ramote_send /mnt/ramote_recv nfs defaults 0 0
    /mnt/ramote_recv/swapfile swap swap defaults 0 0
    

    You can do this across various machines & use multiple swap files for decentralize even more.


    Mirrors for this repository: acid.vegasSuperNETsGitHubGitLabCodeberg

    Visit original content creator repository
    https://github.com/acidvegas/dram

  • universe

    Mesosphere Universe

    Build Status
    CI Build Status
    Universe Server Build Status

    Mesosphere Universe registry of packages made available for DC/OS Clusters.

    Table of Contents

    Universe Purpose

    You can publish and store packages in the Universe repository. The packages can then be consumed by DC/OS. This git repo facilitates these three necessary functions – to publish, store and consume packages. You can publish and store packages in the Universe repository. The packages can then be consumed by DC/OS. If you are new to Universe and Packages, this Get Started Guide is highly recommended.

    Library dependencies

    • jq is installed in your environment.
    • python3 is installed in your environment (minimum python3.5).
    • Docker is installed in your environment.

    Publish a Package

    To publish a package to Universe, fork this repo and open a Pull Request. A set of automated builds will be run against
    the Pull Request to ensure the modifications made in the PR leave the Universe well formed.
    See Creating a Package for details.

    Registry of Packages

    The registry of published packages is maintained as the contents of this repo in the repo/packages directory. As of
    repository version 3.0 multiple packaging versions are allowed to co-exist in the same repository. Validation of
    packages are coordinated based on the packaging version defined in package.json.

    Repository Consumption

    In order for published packages to be consumed and installed in a DC/OS Cluster the Universe Server needs to be built
    and run in a location accessible by the DC/OS Cluster. See Universe Server for details on
    building the Universe artifacts and Server.

    Publish a Package

    Creating a Package

    Each package has its own directory, with one subdirectory for each package revision. Each package revision directory
    contains the set of files necessary to create a consumable package that can be used by a DC/OS Cluster to install
    the package.

    └── repo/package/F/foo
        ├── 0
        │   ├── command.json
        │   ├── config.json
        │   ├── marathon.json.mustache
        │   ├── resource.json
        │   └── package.json
        ├── 1
        │   ├── command.json
        │   ├── config.json
        │   ├── marathon.json.mustache
        │   ├── resource.json
        │   └── package.json
        └── ...
    

    package.json

    Packaging Version
    2.0 required
    3.0 required
    4.0 required

    Every package in Universe must have a package.json file which specifies the high level metadata about the package.

    Currently, a package can specify one of three values for .packagingVersion
    either 2.0 or 3.0 or 4.0; which version is declared
    will dictate which other files are required for the complete package as well as the schema(s) all the files must
    adhere to. Below is a snippet that represents a version 4.0 package.

    See repo/meta/schema/package-schema.json for the full json schema outlining
    what properties are available for each corresponding version of a package.

    {
      "packagingVersion": "4.0",
      "name": "foo",
      "version": "1.2.3",
      "tags": ["mesosphere", "framework"],
      "maintainer": "help@bar.io",
      "description": "Does baz.",
      "scm": "https://github.com/bar/foo.git",
      "website": "http://bar.io/foo",
      "framework": true,
      "upgradesFrom": ["1.2.2"],
      "downgradesTo": ["1.2.2"],
      "minDcosReleaseVersion": "1.10",
      "postInstallNotes": "Have fun foo-ing and baz-ing!",
      "licenses": [{"name": "My license", "url": "http://example.com/license_url"}]
    }

    For the first version of the package, add this line to the beginning of preInstallNotes: This DC/OS Service is currently in preview. There may be bugs, incomplete features, incorrect documentation, or other discrepancies. Preview packages should never be used in production! It will be removed once the package has been tested and used by the community.

    .minDcosReleaseVersion

    Packaging Version
    2.0 not supported
    3.0 optional
    4.0 optional

    Introduced in packagingVersion 3.0, .minDcosReleaseVersion can be specified as a property of package.json.
    When .minDcosReleaseVersion is specified the package will only be made available to DC/OS clusters with a DC/OS
    Release Version greater than or equal to (>=) the value specified.

    For example, "minDcosReleaseVersion" : "1.8" will prevent the package from being installed on clusters older than DC/OS 1.8.

    .upgradesFrom

    Packaging Version
    2.0 not supported
    3.0 not supported
    4.0 optional

    Introduced in packagingVersion 4.0, .upgradesFrom can be specified as a property of package.json.
    When .upgradesFrom is specified this indicates to users that the package is able to upgrade from any of
    the versions listed in the property. It is the resposibility of the package creator to make sure that this
    is indeed the case.

    .downgradesTo

    Packaging Version
    2.0 not supported
    3.0 not supported
    4.0 optional

    Introduced in packagingVersion 4.0, .downgradesTo can be specified as a property of package.json.
    When .downgradesTo is specified this indicates to users that the package is able to downgrade to any of
    the versions listed in the property. It is the resposibility of the package creator to make sure that this
    is indeed the case.

    config.json

    Packaging Version
    2.0 optional
    3.0 optional
    4.0 optional

    This file describes the configuration properties supported by the package, represented as a
    json-schema. Each property can specify whether or not it
    is required, a default value, as well as some basic validation.

    Users can then override specific values at
    installation time by passing an options file to the DC/OS CLI or by setting config values through the
    DC/OS UI (since DC/OS 1.7).

    {
      "type": "object",
      "properties": {
        "foo": {
          "type": "object",
          "properties": {
            "baz": {
              "type": "integer",
              "description": "How many times to do baz.",
              "minimum": 0,
              "maximum": 16,
              "required": false,
              "default": 4
            }
          },
          "required": ["baz"]
        }
      },
      "required": ["foo"]
    }

    marathon.json.mustache

    Packaging Version
    2.0 required
    3.0 optional
    4.0 optional

    This file is a mustache template that when rendered will create a
    Marathon app definition capable of running your service.

    Variables in the mustache template will be evaluated from a union object created by merging three objects in the
    following order:

    1. Defaults specified in config.json

    2. User supplied options from either the DC/OS CLI or the DC/OS UI

    3. The contents of resource.json

    {
      "id": "foo",
      "cpus": 1.0,
      "mem": 1024,
      "instances": 1,
      "args": ["{{{foo.baz}}}"],
      "container": {
        "type": "DOCKER",
        "docker": {
          "image": "{{resource.assets.container.docker.foo23b1cfe8e04a}}",
          "network": "BRIDGE",
          "portMappings": [
            {
              "containerPort": 8080,
              "hostPort": 0,
              "servicePort": 0,
              "protocol": "tcp"
            }
          ]
        }
      }
    }

    See the
    Marathon API Documentation
    for more detailed instruction on app definitions.

    command.json

    Packaging Version
    2.0 optional
    3.0 optional [Deprecated]
    4.0 not supported

    As of packagingVersion 3.0, command.json is deprecated in favor of the .cli property of resource.json.
    See CLI Resources for details.

    Describes how to install the package’s CLI via pip, the Python package manager. This document represents the
    format of a Pip requirements file where each element in the array is a line in the requirements file.

    {
      "pip": [
        "https://pypi.python.org/packages/source/f/foo/foo-1.2.3.tar.gz"
      ]
    }

    Packaging version 4.0 does not support command.json. The presence of command.json in the
    directory will fail the universe validation.

    resource.json

    Packaging Version
    2.0 optional
    3.0 optional
    4.0 optional

    This file contains all of the externally hosted resources (E.g. Docker images, HTTP objects and
    images) needed to install the application.

    See repo/meta/schema/v2-resource-schema.json and
    repo/meta/schema/v3-resource-schema.json for the full
    json schema outlining what properties are available for each corresponding version of a package.

    {
      "images": {
        "icon-small": "http://some.org/foo/small.png",
        "icon-medium": "http://some.org/foo/medium.png",
        "icon-large": "http://some.org/foo/large.png",
        "screenshots": [
          "http://some.org/foo/screen-1.png",
          "http://some.org/foo/screen-2.png"
        ]
      },
      "assets": {
        "uris": {
          "log4j-properties": "http://some.org/foo/log4j.properties"
        },
        "container": {
          "docker": {
            "23b1cfe8e04a": "some-org/foo:1.0.0"
          }
        }
      }
    }
    Docker Images

    For the Docker image, please use the image ID for the referenced image. You can find this by
    pulling the image locally and running docker images some-org/foo:1.0.0.

    Images

    While images is an optional field, it is highly recommended you include icons and screenshots
    in resource.json and update the path definitions accordingly. Specifications are as follows:

    • icon-small: 48px (w) x 48px (h)
    • icon-medium: 96px (w) x 96px (h)
    • icon-large: 256px (w) x 256px (h)
    • screenshots[...]: 1200px (w) x 675px (h)

    NOTE: To ensure your service icons look beautiful on retina-ready displays,
    please supply 2x versions of all icons. No changes are needed to
    resource.json – simply supply an additional icon file with the text @2x in
    the name before the file extension.
    For example, the icon icon-cassandra-small.png would have a retina-ready
    alternate image named icon-cassandra-small@2x.png.

    CLI Resources

    Packaging Version
    2.0 not supported
    3.0 optional
    4.0 optional

    The new .cli property allows for a package to configure native CLI subcommands for several platforms and
    architectures.

    {
      "cli":{
        "binaries":{
          "darwin":{
            "x86-64":{
              "contentHash":[
                { "algo": "sha256", "value": "..." }
              ],
              "kind": "executable",
              "url":"https://some.org/foo/1.0.0/cli/darwin/dcos-foo"
            }
          },
          "linux":{
            "x86-64":{
              "contentHash":[
                { "algo":"sha256", "value":"..." }
              ],
              "kind":"executable",
              "url":"https://some.org/foo/1.0.0/cli/linux/dcos-foo"
            }
          },
          "windows":{
            "x86-64":{
              "contentHash":[
                { "algo":"sha256", "value":"..." }
              ],
              "kind":"executable",
              "url":"https://some.org/foo/1.0.0/cli/windows/dcos-foo"
            }
          }
        }
      }
    }

    Submit your Package

    Developers are invited to publish a package containing their DC/OS Service by submitting a Pull Request targeted at
    the version-3.x branch of this repo.

    Full Instructions:

    1. Fork this repo and clone the fork:
    git clone https://github.com/<user>/universe.git /path/to/universe
    1. Run the verification and build script:
    scripts/build.sh
    1. Verify all build steps completed successfully

    2. Ensure the license field in package.json is completed. Without a license attribution we cannot accept pull requests.

    3. Submit a pull request against the version-3.x branch with your changes. Every pull request opened will have a set
      of automated verifications run against it. These automated verification are reported against the pull request using
      the GitHub status API. All verifications must pass in order for a pull request to be eligible for merge.

    4. Respond to manual review feedback provided by the DC/OS Community.

    • Each Pull Request to Universe will also be manually reviewed by a member of the DC/OS Community. To ensure your
      package is able to be made available to users as quickly as possible be sure to respond to the feedback provided.
    1. Add a getting started example of how to install and use the DC/OS package. To add the example, fork the examples repo and send in a pull request. Re-use the format from the existing examples there.

    Repository Consumption

    In order for Universe to be consumed by DC/OS the build process needs to be run to create the Universe Server. This section describes how to test a package before releasing it to public Universe. See Local Universe for running universe server on air-gapped clusters.

    Universe Server

    Universe Server is a new component introduce alongside packagingVersion 3.0. In order for Universe to be able to
    provide packages for many versions of DC/OS at the same time, it is necessary for a server to be responsible for serving
    the correct set of packages to a cluster based on the cluster’s version.

    All Pull Requests opened for Universe and the version-3.x branch will have their Docker image built and published
    to the DockerHub image mesosphere/universe-server.
    In the artifacts tab of the build results you can find docker/server/marathon.json which can be used to run the
    Universe Server for testing in your DC/OS cluster. For each Pull Request, click the details link of the “Universe Server
    Docker image” status report to view the build results.

    Build Universe Server locally

    1. Validate and build the Universe artifacts
    scripts/build.sh
    1. Build the Universe Server Docker image
    DOCKER_IMAGE="my-org/my-image" DOCKER_TAG="my-package" docker/server/build.bash

    This will create a Docker image universe-server:my-package and docker/server/target/marathon.json on your local machine

    1. If you would like to publish the built Docker image, run
    DOCKER_IMAGE="my-org/my-image" DOCKER_TAG="my-package" docker/server/build.bash publish

    Run Universe Server

    Using the marathon.json that is created when building Universe Server we can run a Universe Server in our DC/OS
    Cluster which can then be used to install packages.

    Run the following commands to configure DC/OS to use the custom Universe Server (DC/OS 1.8+):

    dcos marathon app add marathon.json
    dcos package repo add --index=0 dev-universe http://universe.marathon.mesos:8085/repo

    For DC/OS 1.7, a different URL must be used:

    dcos marathon app add marathon.json
    dcos package repo add --index=0 dev-universe http://universe.marathon.mesos:8085/repo-1.7

    Consumption Protocol

    A DC/OS Cluster can be configured to point to multiple Universe Servers; each Universe Server will be fetched via
    HTTPS or HTTP. When a DC/OS Cluster attempts to fetch the package set from a Universe Server, the Universe Server
    will provide ONLY those packages which can be run on the cluster.

    For example:
    A DC/OS 1.6.1 Cluster will only receive packages with a minDcosReleaseVersion less than or equal to (<=) 1.6.1
    in the format the DC/OS Cluster expects.

     +----------------------+   +-----------------------+
     │public universe server│   │private universe server│
     +----------------------+   +-----------------------+
                    http \         / http
                          \       /
                           \     /
                           +-----+           +--------+
                           │DC/OS│-----------│Marathon│
                           +-----+    http   +--------+
    

    Supported DC/OS Versions

    Currently Universe Server provides support for the following versions of DC/OS

    DC/OS Release Version Support Level
    1.6.1 Deprecated
    1.7 Deprecated
    1.8 Full Support
    1.9 Full Support
    1.10 Full Support
    1.11 Full Support
    1.12 Full Support
    1.13 Full Support
    2.0 Full Support


    Visit original content creator repository
    https://github.com/d2iq-archive/universe

  • HoloPortrait

    HoloPortrait

    Portrait photo to Hologram all-in-one script

    Hardware Requirements

    Software Requirements

    iOS

    • Pythonista app
    • Internet connection required for the first run. Subsequent usage is possible offline.

    PC (only needed for the initial setup)

    Setup

    1. Connect the Looking Glass display to a PC with HoloPlay service installed and visit https://eka.hn/calibration_test.html
    2. Copy the JSON block provided by the website and use it to replace the hardcoded calibration data on row 51 of HoloPortrait.py
    3. Transfer HoloPortrait.py to Pythonista and run it with a Python 3.x interpreter
    4. You will be asked to pick a photo that should be turned into a hologram. If you choose a photo that does not contain a depth map, the depth map will be automatically inferred using a machine learning model. This happens locally on your device, no data is ever sent anywhere.
    5. You can disable the ML inferrence by editing row 81 of HoloPortrait.py. In this mode you will be allowed to choose only from Portrait photos. If you don’t own a device capable of taking Portrait photos, you can download one of the sample photos provided in this repository: Sample 1 Sample 2

    Demo

    Colormap demo

    See it in action here.

    Legacy version

    This is a second generation of HoloPortrait, made possible thanks to the driverless-HoloPlay.js library and iOS-LookingGlass browser. It performs 30x faster than the first generation and it offers additional improvements like switching between Mesh and Pointcloud modes. To read more about the Legacy version of the script, see README_legacy.md.

    Credits

    The Mesh code is based on a Custom Geometry example by threejsfundamentals.org.

    Visit original content creator repository https://github.com/jankais3r/HoloPortrait
  • comandos-git

    Principais comandos para usar no Git

    👨🏽‍💻 Guia para devs e divas cansados de pesquisar os comandos no Google.


    MIT License

    Apoie os meus estudos, adquirindo os produtos da minha loja, feita para programadores! Clique aqui para conferir.


    🎓 Autor


    🐣 Criando um projeto

    Comando Descrição
    git init Transforma o diretório atual em um repositório do Git, possibilitando assim a gravação de revisões do projeto
    git init nome-da-pasta Cria um repositório do Git vazio na pasta especificada.

    🤼 Clonando um repositório

    Comando Descrição
    git clone link-do-repositorio Cria uma cópia de um repositório existente.

    🏠 Mudanças locais

    Comando Descrição
    git add . Adiciona todos os arquivos da pasta onde você se encontra à Staging Area (que é local), preparando todas as alterações. No entanto, esse comando não tem efeito real e significativo no repositório — as alterações não são gravadas mesmo até você executar git commit
    git add nome-do-arquivo Envia os arquivos modificados para a Staging Area
    git status Permite que você veja todas as alterações do projeto monitoradas pelo git
    git commit -m "mensagem clara explicando a mudança no código" Cria uma versão do seu projeto com os arquivos que estiverem na Staging Area e descreve uma mensagem explicando as modificações realizadas. Em resumo, um commit funciona como tirar uma foto. Importante: não esquecer do comando -m e das aspas ao redor da mensagem
    comme "mensagem clara explicando a mudança no código" É a junção do git add com o git commit, já adicionando os arquivos a staging area e efetuando um commit
    git commit --amend -m "mensagem clara explicando a mudança no código" Modifica o último commit. Em vez de criar um novo commit, as mudanças preparadas são adicionadas ao commit anterior.

    💬 Histórico

    Comando Descrição
    git log Permite verificar o histórico de commits do projeto, começando pelo mais novo
    git log -- graph Mostra de forma mais descritiva e visual o que está acontecendo
    git log -p nome-do-arquivo Mostra as mudanças ao longo do tempo para um arquivo específico
    git blame nome-do-arquivo Mostra quem alterou o quê e quando

    🕸 Branches

    Comando Descrição
    git branch Lista todas as branches no seu repositório local. A branch padrão se chama master ou main
    git branch nome-da-branch Permite criar uma nova branch, com o nome que você escolheu
    git checkout nome-da-branch Permite acessar uma branch que já foi criada (localmente ou remota)
    gc nome-da-branch Faz a mesma coisa que o comando anterior
    git checkout -b nome-da-branch Cria uma nova branch e já acessa diretamente
    gcb nome-da-branch Faz a mesma coisa que o comando anterior
    git branch -D nome-da-branch Exclui sua branch
    git merge Mescla as linhas de desenvolvimento. De modo geral, esse comando é usado para combinar alterações feitas em dois branches distintos. Por exemplo, um desenvolvedor faria merge quando quisesse combinar alterações de um branch de recurso no branch principal para implantação.
    git push origin nome-da-branch Empurra a branch para o espaço remoto, juntamente com todos os commits e objetos. Também as branches no repositório remoto caso ainda não existam.
    pushme nome-da-branch Efetua o commit e faz push para o repositório

    ✅ Atualizar e Publicar

    Comando Descrição
    git fetch Puxa todas as informações de um repositório remoto para seu repositório local, de forma segura, deixando o trabalho atual intacto
    git merge Atualiza o estado de trabalho do repositório local com as modificações puxadas pelo comando git fetch, modificando a branch ativa
    git pull É a junção dos comandos git fetch e git merge, atualizando imediatamente a branch ativa no seu repositório local com as alterações commitadas na branch remota
    `git push Envia as suas alterações feitas para a branch no repositório remoto. Só envia as alterações que foram commitadas

    😱 O melhor dos mundos

    Comando Descrição
    git add . && git commit -m "mensagem clara explicando a mudança no código" && git push origin nome-da-branch Utliza o “&&” para fazer 3 comandos ao mesmo tempo, adicionando as alterações na staging area, commitando o código e o enviando para o repositório remoto.

    🤝🏽 Contribua com esse guia!

    Contribuições são sempre bem-vindas!

    Este é um projeto totalmente livre que aceita contribuições via pull requests no GitHub. Este documento tem a responsabilidade de alinhar as contribuições de acordo com os padrões estabelecidos no mesmo. Em caso de dúvidas, abra uma issue.

    1. Fork este repositório. Caso não saiba como fazer isso, clique aqui para conferir.
    2. Verifique se as informações estão corretas e se irá ajudar outros devs e divas.
    3. Envie seus commits.
    4. Solicite a pull request.
    5. Insira um pequeno resumo dos links adicionados.
    Visit original content creator repository https://github.com/matheusqueirozds/comandos-git