<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Malisha Tharindu on Medium]]></title>
        <description><![CDATA[Stories by Malisha Tharindu on Medium]]></description>
        <link>https://medium.com/@malisha?source=rss-c4197550f497------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*l9MC0omXIAltiFhNGSknzw.png</url>
            <title>Stories by Malisha Tharindu on Medium</title>
            <link>https://medium.com/@malisha?source=rss-c4197550f497------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 19:45:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@malisha/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Add Google Sign in to you Flutter app just infew steps]]></title>
            <link>https://malisha.medium.com/add-google-sign-in-to-you-flutter-app-just-infew-steps-e66463dd41fe?source=rss-c4197550f497------2</link>
            <guid isPermaLink="false">https://medium.com/p/e66463dd41fe</guid>
            <category><![CDATA[firebaseauthentication]]></category>
            <category><![CDATA[google-signin]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[firebase-flutter-auth]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Malisha Tharindu]]></dc:creator>
            <pubDate>Fri, 13 May 2022 20:01:16 GMT</pubDate>
            <atom:updated>2022-05-13T20:01:16.312Z</atom:updated>
            <content:encoded><![CDATA[<h3>Add Google Sign in to you Flutter app just in few steps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lHsAJ9boXF6uCyaXUXXX7Q.gif" /><figcaption>Preview</figcaption></figure><p>Following steps might be helpful to achieve.</p><h4>1. Setting up your project</h4><p>Setup your Flutter project</p><h4>2. Adding pub.dev library</h4><pre>firebase_auth<br>google_sign_in</pre><h4>3. Implement Google Sign in functionality</h4><h4>4. Creating firebase project</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GdbjM0qamzsJeiAK.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SZWNqEjA6tfjbI-i.png" /><figcaption>Register your android app<strong>,</strong> which is generally your <strong>application Id </strong>in your app-level <strong>build. Gradle</strong>.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ikc5j98drUHE3YBs.png" /><figcaption><em>Download the </em><strong><em>google-services.json. </em></strong><em>Move the downloaded google-serivces.json file into your Android</em><strong><em> app module root directory</em></strong><em>.</em></figcaption></figure><ul><li>Add your<strong> project-level build.gradle</strong> file.</li></ul><pre>dependencies <strong>{<br>    </strong>classpath &#39;com.android.tools.build:gradle:3.5.0&#39;<br>    classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;<br>classpath &#39;com.google.gms:google-services:4.3.3&#39;<br><strong>}</strong></pre><ul><li>Add to your <strong>project app-level build. Gradle </strong>file</li></ul><pre>dependencies <strong>{<br>    </strong>implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;<br>    implementation &#39;com.google.firebase:firebase-analytics:17.2.2&#39;<strong>}<br></strong>apply plugin: &#39;com.google.gms.google-services&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k8GAOpMMOJMEsNb-.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UgD7WYnT4Gt9XI3B.png" /><figcaption>Set up the sign-in method.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wKXQwZtyPbx0Ujxb.png" /><figcaption>Project name and support email.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z77Zok723nuPMnWF.png" /><figcaption>Go to project settings and then open the general tab.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B_jT6vNnDv8b9J25.png" /><figcaption>Add the <strong>SHA</strong> key.</figcaption></figure><h4>5. Getting SHA-1 key</h4><p>To generate SHA key please follow this link <a href="https://developers.google.com/android/guides/client-auth">https://developers.google.com/android/guides/client-auth</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KgUP7k79tZ7fXlG7-bh27Q.png" /></figure><h4>7. Adding google authentication</h4><p>create an instance of GoogleSignIn.</p><pre>final FirebaseAuth _auth = FirebaseAuth.<em>instance</em>;<br>final GoogleSignIn _googleSignIn = GoogleSignIn();</pre><h4>8. Testing our app functionality</h4><p>Add this code to your main.dart file and run and test it</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:google_sign_in/google_sign_in.dart&#39;;</pre><pre>void main() {<br>  runApp(const MaterialApp(<br>    home: Home(),<br>  ));<br>}</pre><pre>final GoogleSignIn _googleSignIn = GoogleSignIn(scopes: [&#39;email&#39;]);</pre><pre>class Home extends StatefulWidget {<br>  const Home({Key? key}) : super(key: key);</pre><pre><a href="http://twitter.com/override">@override</a><br>  _HomeState createState() =&gt; _HomeState();<br>}</pre><pre>class _HomeState extends State&lt;Home&gt; {<br>  GoogleSignInAccount? _currentUser;</pre><pre><a href="http://twitter.com/override">@override</a><br>  void initState() {<br>    _googleSignIn.onCurrentUserChanged.listen((account) {<br>      setState(() {<br>        _currentUser = account;<br>      });<br>    });<br>    _googleSignIn.signInSilently();<br>    super.initState();<br>  }</pre><pre><a href="http://twitter.com/override">@override</a><br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(<br>        title: const Text(&#39;Flutter Google Sign in&#39;),<br>      ),<br>      body: Container(<br>        alignment: Alignment.center,<br>        child: _buildWidget(),<br>      ),<br>    );<br>  }</pre><pre>Widget _buildWidget() {<br>    GoogleSignInAccount? user = _currentUser;<br>    if (user != null) {<br>      return Padding(<br>        padding: const EdgeInsets.fromLTRB(2, 12, 2, 12),<br>        child: Column(<br>          children: [<br>            ListTile(<br>              leading: GoogleUserCircleAvatar(identity: user),<br>              title: Text(<br>                user.displayName ?? &#39;&#39;,<br>                style: TextStyle(fontSize: 22),<br>              ),<br>              subtitle: Text(user.email, style: TextStyle(fontSize: 22)),<br>            ),<br>            const SizedBox(<br>              height: 20,<br>            ),<br>            const Text(<br>              &#39;Signed in successfully&#39;,<br>              style: TextStyle(fontSize: 20),<br>            ),<br>            const SizedBox(<br>              height: 10,<br>            ),<br>            ElevatedButton(onPressed: signOut, child: const Text(&#39;Sign out&#39;))<br>          ],<br>        ),<br>      );<br>    } else {<br>      return Padding(<br>        padding: const EdgeInsets.all(12.0),<br>        child: Column(<br>          children: [<br>            const SizedBox(<br>              height: 20,<br>            ),<br>            const Text(<br>              &#39;You are not signed in&#39;,<br>              style: TextStyle(fontSize: 30),<br>            ),<br>            const SizedBox(<br>              height: 10,<br>            ),<br>            ElevatedButton(<br>                onPressed: signIn,<br>                child: const Padding(<br>                  padding: EdgeInsets.all(8.0),<br>                  child: Text(&#39;Sign in&#39;, style: TextStyle(fontSize: 30)),<br>                )),<br>          ],<br>        ),<br>      );<br>    }<br>  }</pre><pre>void signOut() {<br>    _googleSignIn.disconnect();<br>  }</pre><pre>Future&lt;void&gt; signIn() async {<br>    try {<br>      await _googleSignIn.signIn();<br>    } catch (e) {<br>      print(&#39;Error signing in $e&#39;);<br>    }<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lHsAJ9boXF6uCyaXUXXX7Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e66463dd41fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is better, Riverpod or Provider for Flutter state management solution?]]></title>
            <link>https://malisha.medium.com/what-is-better-riverpod-or-provider-for-flutter-state-management-solution-3b710656cc83?source=rss-c4197550f497------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b710656cc83</guid>
            <category><![CDATA[provider]]></category>
            <category><![CDATA[riverpod]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[state-management]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Malisha Tharindu]]></dc:creator>
            <pubDate>Fri, 13 May 2022 05:06:24 GMT</pubDate>
            <atom:updated>2022-05-13T05:06:24.656Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DiJUwBFEuIpGRxouH1ztxQ.png" /></figure><blockquote><em>Provider package is certainly a great tool, however, Riverpod has extended its capacity.</em></blockquote><blockquote>However, flutter creators still recommend Provider as the stable state management mechanism at the time of writing this post.</blockquote><p>By the way provider has some limitations but Riverpod has overcome those limitations. As well Riverpod is fast, reliable, perfect.</p><p>Below are the my facts for why you should choose Riverpod:</p><ol><li>Riverpod is flutter independent as we can achieve the above mentioned features by not using InheritedWidgtes any more. Riverpod implements its own mechanism. Riverpod is <strong>completely independent from the widget tree</strong></li></ol><p>2. Riverpod can be used to create and enforce unidirectional data flow with model classes that are immutable.</p><p>3. Riverpod does not depend directly on the widget tree; its operation is similar to that of a service locator. Providers are declared globally and can be used anywhere in the application</p><p>6. ensures code testability and catch programming errors at <strong>compile-time</strong> rather than at runtime. So it has improved compile safety.</p><p>7. Riverpod allows you to easily <strong>create</strong>, <strong>access</strong>, and <strong>combine</strong> providers with minimal boilerplate code</p><p>8. comparison of previous and new state</p><p>9. implements an undo-redo mechanism</p><p>10.debug application state and can inspect your state in the devtool</p><p>Watch this video to get idea about Riverpod <a href="https://www.youtube.com/watch?v=GVspNESSess">https://www.youtube.com/watch?v=GVspNESSess</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b710656cc83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn quickly, PHP and MySQL create, read, update, and delete (CRUD)]]></title>
            <link>https://malisha.medium.com/learn-quickly-php-and-mysql-create-read-update-and-delete-crud-f2b9b8dcaa2d?source=rss-c4197550f497------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2b9b8dcaa2d</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[php-basic]]></category>
            <category><![CDATA[crud]]></category>
            <category><![CDATA[php7]]></category>
            <dc:creator><![CDATA[Malisha Tharindu]]></dc:creator>
            <pubDate>Wed, 05 May 2021 05:46:42 GMT</pubDate>
            <atom:updated>2021-05-05T06:15:38.516Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ieI_-JHDD7F3XxbaMdpF9A.jpeg" /><figcaption>How deal with server, database and table</figcaption></figure><p>PHP stands for Hypertext Preprocessor. PHP was originally created by Rasmus Lerdorf in 1994. It was initially known as Personal Home Page and it is an open source language.</p><p>PHP code is executed on the server, and the result is returned to the browser as plain HTML. So you can generate pages and files dynamically as well you can create, open, read, write and close files on the server.</p><p>Try following steps, lets jump to learning basics of php operations.</p><p>1. install local server (Xampp or Wamp for Windows users, Mamp for mac or other solution)</p><p>2. Test by running localhost/phpmyadmin web browser (here you will see databases and tables)</p><p>3. Make new folder for project in htdocs or www folder</p><p>4. open created project in VS Code</p><p>5. Create index.php <br>(Note : use this file to try following tasks and edit file as accordingly)</p><p>6. Do some basics stuffs of PHP(operators, echo or print html elements)</p><pre><br>&lt;?php // Displaying HTML code print</pre><pre>$myName = &quot;Malisha&quot;;</pre><pre>echo &quot;&lt;h1&gt;Hi I&#39;m $myName.&lt;/h4&gt;&quot;; </pre><pre>print &quot;&lt;h4 style=&#39;color: red;&#39;&gt;This is heading with style.&lt;/h4&gt;&quot;; ?&gt;</pre><p>7. Make server connection (Do it and test it using following code)</p><pre>&lt;?php</pre><pre>$servername = “localhost”;</pre><pre>$username = “username”;</pre><pre>$password = “password”;</pre><pre>// Create connection</pre><pre>$conn_server = new mysqli($servername, $username, $password);</pre><pre>// Check connection</pre><pre>if ($conn_server-&gt;connect_error) {</pre><pre>die(“Connection failed: “ . $conn_server-&gt;connect_error);</pre><pre>}</pre><pre>echo “Connected successfully”;</pre><pre>?&gt;<br></pre><p>8. Create database using php and mysql</p><pre>// Create database<br>$sql = &quot;CREATE DATABASE myDB&quot;;<br>if ($conn_server-&gt;query($sql) === TRUE) {<br>  echo &quot;Database created successfully&quot;;<br>} else {<br>  echo &quot;Error creating database: &quot; . $conn-&gt;error;<br>}</pre><p>Note after you create a database, you have to make new connection as step 9.</p><p>9. Make connection to database</p><pre>// Create connection to database</pre><pre>$dbname = &quot;myDB&quot;;<br>$conn = new mysqli($servername, $username, $password, $dbname);<br>// Check connection<br>if ($conndb-&gt;connect_error) {<br>  die(&quot;Connection failed: &quot; . $conndb-&gt;connect_error);<br>}</pre><p>Use above connection ($conn) when you do below tasks.</p><p>10. Create Table using php and mysql</p><pre>// sql to create table<br>$sql = &quot;CREATE TABLE MyStudents (<br>id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,<br>firstname VARCHAR(30) NOT NULL,<br>lastname VARCHAR(30) NOT NULL,<br>email VARCHAR(50),<br>reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP<br>)&quot;;<br><br>if ($conn-&gt;query($sql) === TRUE) {<br>  echo &quot;Table MyStudents created successfully&quot;;<br>} else {<br>  echo &quot;Error creating table: &quot; . $conn-&gt;error;<br>}</pre><p>11. then insert data into table you create</p><pre>$sql = &quot;INSERT INTO MyStudents (firstname, lastname, email)<br>VALUES (&#39;Kamal&#39;, &#39;Perera&#39;, &#39;perera@example.com&#39;)&quot;;<br><br>if ($conn-&gt;query($sql) === TRUE) {<br>  echo &quot;New record created successfully&quot;;<br>} else {<br>  echo &quot;Error: &quot; . $sql . &quot;&lt;br&gt;&quot; . $conn-&gt;error;<br>}</pre><p>12. Select data from table</p><pre>$sql = &quot;SELECT id, firstname, lastname FROM MyStudents&quot;;<br>$result = $conn-&gt;query($sql);<br><br>if ($result-&gt;num_rows &gt; 0) {<br>  // output data of each row<br>  while($row = $result-&gt;fetch_assoc()) {<br>    echo &quot;id: &quot; . $row[&quot;id&quot;]. &quot; - Name: &quot; . $row[&quot;firstname&quot;]. &quot; &quot; . $row[&quot;lastname&quot;]. &quot;&lt;br&gt;&quot;;<br>  }<br>} else {<br>  echo &quot;0 results&quot;;<br>}</pre><p>13. Select and Filter Data With MySQLi</p><pre>$sql = &quot;SELECT id, firstname, lastname FROM MyStudents WHERE lastname=&#39;Perera&#39;&quot;;<br>$result = $conn-&gt;query($sql);<br><br>if ($result-&gt;num_rows &gt; 0) {<br>  // output data of each row<br>  while($row = $result-&gt;fetch_assoc()) {<br>    echo &quot;id: &quot; . $row[&quot;id&quot;]. &quot; - Name: &quot; . $row[&quot;firstname&quot;]. &quot; &quot; . $row[&quot;lastname&quot;]. &quot;&lt;br&gt;&quot;;<br>  }<br>} else {<br>  echo &quot;0 results&quot;;<br>}</pre><p>14. Update data</p><pre>$sql = &quot;UPDATE MyStudents SET lastname=&#39;Doe&#39; WHERE id=1&quot;;<br><br>if ($conn-&gt;query($sql) === TRUE) {<br>  echo &quot;Record updated successfully&quot;;<br>} else {<br>  echo &quot;Error updating record: &quot; . $conn-&gt;error;<br>}</pre><p>15. Delete Data</p><pre>// sql to delete a record<br>$sql = &quot;DELETE FROM MyStudents WHERE id=1&quot;;</pre><pre>if ($conn-&gt;query($sql) === TRUE) {<br>  echo &quot;Record deleted successfully&quot;;<br>} else {<br>  echo &quot;Error deleting record: &quot; . $conn-&gt;error;<br>}</pre><p>Next steps : you have to make separate files for separated PHP codes. Build HTML forms and use to take user inputs by name and get them to relevant php file via POST or GET methods. Save these values to php variables and used them for these discussed crud operations such as INSERT, SELECT, DELETE and UPDATE. we will discuss this later.</p><p>Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2b9b8dcaa2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to release iOS app to TestFlight]]></title>
            <link>https://malisha.medium.com/how-to-release-ios-app-to-testflight-6e73f7ddad0?source=rss-c4197550f497------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e73f7ddad0</guid>
            <category><![CDATA[app-store-connect]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[ios-app-publish]]></category>
            <category><![CDATA[testflight]]></category>
            <dc:creator><![CDATA[Malisha Tharindu]]></dc:creator>
            <pubDate>Wed, 19 Aug 2020 06:37:44 GMT</pubDate>
            <atom:updated>2020-08-19T06:37:44.441Z</atom:updated>
            <content:encoded><![CDATA[<p>Steps</p><ol><li>Open your project on Xcode</li><li>Go preference and select Accounts and sign with Apple id</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OA6RNce0_4icPI1Rmrb-dA.png" /></figure><p>3. Under the Project — Targets -&gt; General ; Update the identity details such as Version, Build</p><p>4. Then Select Device; Generic iOS Device</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nt1XuK5VyxwPZxEe58rIg.png" /></figure><p>5. Then click Archive under product.</p><p>6. Open Organizer under Windows to check status of Archiving</p><p>7. Then Validate app — Follow steps by clicking Next button</p><p>8. Distribute app — Follow steps by clicking Next button, then it will be uploaded to App Store Connect.</p><p>8. Open App Store Connect and Login (there will have app is processing state in Activities Section)<br> <a href="https://appstoreconnect.apple.com/login">https://appstoreconnect.apple.com/login</a></p><p>9. After processes complete go to TestFlight tab and click on build app and update missing compliance(Click No)</p><p>10. Then fill the test details and add testers to app build.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e73f7ddad0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Objective-C UIAlertController to Show DialogBox (Alert Box) with Multiple Buttons]]></title>
            <link>https://malisha.medium.com/objective-c-uialertcontroller-to-show-dialogbox-alert-box-with-multiple-buttons-7df1766def9f?source=rss-c4197550f497------2</link>
            <guid isPermaLink="false">https://medium.com/p/7df1766def9f</guid>
            <category><![CDATA[iphone-alert]]></category>
            <category><![CDATA[uialertcontroller]]></category>
            <category><![CDATA[uialertviewcontroller]]></category>
            <category><![CDATA[objective-c-alert-view]]></category>
            <category><![CDATA[objective-c]]></category>
            <dc:creator><![CDATA[Malisha Tharindu]]></dc:creator>
            <pubDate>Tue, 11 Aug 2020 11:04:48 GMT</pubDate>
            <atom:updated>2020-08-11T11:06:09.647Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="objective C UIAlertViewController" src="https://cdn-images-1.medium.com/max/1024/1*7F7x9VOyOxc4Fjsl3yKZ3g.jpeg" /></figure><p>#objectiveC #UIAlertViewController #iOSDevelopment</p><p>Here I use UIAlertController to make an alert/dialog box.</p><pre>//Initialize UIAlertController and its title and subtitle<br>UIAlertController *alert = [UIAlertController alertControllerWithTitle:@”Tittle” message:@”Subtitle” preferredStyle:UIAlertControllerStyleAlert];</pre><pre>//Button 1<br>UIAlertAction *actionButton1 = [UIAlertAction actionWithTitle:@”Button1” style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {</pre><pre>//code for performing acctions to be excuted when click Button1<br>NSLog(@”Button 1 Pressed”);</pre><pre>}];</pre><pre>//Button 2<br>UIAlertAction *actonButton2 = [UIAlertAction actionWithTitle:@”Button2” style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {</pre><pre>//code for performing acctions to be excuted when click Button2<br>NSLog(@”Button 2 Pressed”);</pre><pre>}];</pre><pre>[alert addAction: actonButton1];</pre><pre>[alert addAction: actonButton2];</pre><pre>[self presentViewController:alert animated:YES completion:^{</pre><pre>//code for performing acctions to be excuted when UIAlertController is started</pre><pre>NSLog(@”dffefe”);</pre><pre>}];</pre><p>you can Implement this code block inside action or function.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7df1766def9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[git ssh key for all git Accounts]]></title>
            <link>https://malisha.medium.com/git-ssh-key-for-all-git-accounts-4cc4b8aecf18?source=rss-c4197550f497------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cc4b8aecf18</guid>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <category><![CDATA[git-ssh]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[Malisha Tharindu]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 08:45:52 GMT</pubDate>
            <atom:updated>2020-07-29T09:38:23.487Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jznl9d8eFhouOmCqHZhAmw.png" /></figure><ol><li><strong>Generate ssh Key with comment</strong></li></ol><pre>$ ssh-keygen -t rsa -b 4096 -C &quot;<em>your_email@example.com</em>&quot;</pre><p><strong>2. Add agent</strong></p><pre>$ eval &quot;$(ssh-agent -s)&quot;</pre><p>add the ssh id to agent</p><pre>$ ssh-add -K ~/.ssh/id_rsa</pre><p><strong>3. Open .ssh/ config file</strong></p><pre>$ open ~/.ssh/config</pre><p>If there no config file you have to create using the following command</p><p>Add following code in the ssh config file for all type host</p><pre>Host *<br>  AddKeysToAgent yes<br>  UseKeychain yes<br>  IdentityFile ~/.ssh/id_rsa</pre><p><strong>4. Copy to add ssh key to your GitHub</strong></p><pre>pbcopy &lt; ~/.ssh/id_rsa.pub</pre><p><strong>5. Check</strong></p><pre>ssh -T git@github.com</pre><p>Done.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cc4b8aecf18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terminal Cheat Sheet]]></title>
            <link>https://malisha.medium.com/terminal-cheat-sheet-c1b96ac8b7f6?source=rss-c4197550f497------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1b96ac8b7f6</guid>
            <category><![CDATA[cheatsheet]]></category>
            <category><![CDATA[mac-os-x]]></category>
            <category><![CDATA[terminal-commands]]></category>
            <dc:creator><![CDATA[Malisha Tharindu]]></dc:creator>
            <pubDate>Tue, 26 May 2020 11:03:52 GMT</pubDate>
            <atom:updated>2020-05-26T11:04:53.745Z</atom:updated>
            <content:encoded><![CDATA[<p>Here some of useful Terminal commands for Mac users.</p><h4>Basic</h4><pre><strong>pwd       </strong>#<em>print working directory</em></pre><pre><strong>ls</strong>        #list files in directory</pre><pre><strong>clear     </strong>#clear the terminal screen of all previous commands </pre><pre><strong>cd</strong>        #change directory</pre><pre><strong>~</strong>         #home directory (cd~ #this will change directory to home         directory)</pre><pre><strong>.. </strong>       #up one directory (<strong>cd ..</strong> #this will change directory to up one)</pre><pre><strong>-         </strong>#previous working directory (use <strong>cd -</strong>)</pre><pre><strong>help</strong>      #get help<br><strong>-h</strong>        #get help<br><strong>--help   </strong> #get help</pre><pre><strong>man</strong>       #manual</pre><pre><strong>cat</strong>       #output the contents of a file</pre><pre><strong>mkdir</strong>     #create new directory</pre><pre><strong>open</strong>      #open a file with the associated program, a directory with Finder, or a URL with the default web browser</pre><pre><strong>ps</strong>        #list all running processes</pre><pre><strong>kill</strong>      #terminate existing process</pre><pre><strong>rmd</strong>       #permanently delete file</pre><pre><strong>rmdir</strong>     #remove directory </pre><h4>Git</h4><p>When working with <strong>Git</strong> following commands will be used frequently</p><pre><strong>git clone &lt;url&gt;</strong>                #Clone directory</pre><pre><strong>git checkout -b &lt;new-branch&gt;</strong>   #Create new local branchgit push -u </pre><pre><strong>origin &lt;new-branch&gt;</strong>            #Sync local branch with remote</pre><pre><strong>git checkout &lt;branch&gt;</strong>          #Checkout branch</pre><pre><strong>git push origin &lt;branch&gt;       </strong>#Push branch to remote</pre><pre><strong>git branch -d &lt;branchname&gt;</strong>     #Deletes local branch</pre><pre><strong>git push origin :&lt;branchname&gt;  </strong>#Deletes remote branch </pre><pre><strong>git subtree push --prefix docs origin gh-pages </strong> #Push docs as subtree to gh-pages</pre><pre><strong><br>git branch -m &lt;oldname&gt; &lt;newname&gt; </strong>  #Rename branch</pre><pre><strong>git branch -m &lt;newname&gt;</strong>             #Rename current branch</pre><pre><strong>git branch -d &lt;branchname&gt;</strong>         #deletes local branch</pre><pre><strong>git push origin :&lt;branchname&gt;</strong>      #deletes remote branch</pre><pre><strong>git remote prune &lt;branchname&gt;      </strong>#update local/remote sync</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1b96ac8b7f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Local WordPress Setup in 5 Minutes using Valet for Mac users]]></title>
            <link>https://malisha.medium.com/local-wordpress-setup-in-5-minutes-using-valet-for-mac-users-1d39ee1efdd4?source=rss-c4197550f497------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d39ee1efdd4</guid>
            <category><![CDATA[localhost]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[valet]]></category>
            <category><![CDATA[wordpress-install-in-mac]]></category>
            <category><![CDATA[mac]]></category>
            <dc:creator><![CDATA[Malisha Tharindu]]></dc:creator>
            <pubDate>Tue, 10 Mar 2020 21:24:39 GMT</pubDate>
            <atom:updated>2020-03-11T04:09:51.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*dE_jCLNyZHv9QImUN7CsbQ.png" /></figure><p>Hello Mac people,<br>This is brought you a solution for those who struggle to install Wordpress locally on Mac. Recently I got an Apple Mac Book pro to develop iOS apps due to my career aspects. So I had to move from Windows to Mac 🙄. In windows, I used Xamp or Wamp to create WordPress projects locally. But in Mac, I found this nice method to create Wordpress projects locally. Sharing is caring 😋.</p><p>First, what is <strong>Valet</strong>? <br><a href="https://laravel.com/docs/5.7/valet">Valet</a> is a <a href="https://laravel.com/">Laravel</a> development environment for Mac minimalists that doesn’t rely on Vagrant or Docker to load a separate operating system. So let&#39;s see how I did it…</p><p>Before you start, you have to make sure to obtain the following technical requirements.</p><p>Technical requirements 🛠</p><ul><li>First thing, you are on a mac 💻 🖥</li><li><a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">Git</a> is installed</li><li><a href="https://brew.sh/">Homebrew</a> is installed</li><li><a href="https://getcomposer.org/doc/00-intro.md">Composer</a> is installed</li><li>MySQL is installed- if you familiar with command line or you can use a GUI like MySQL Workbench or <a href="https://www.sequelpro.com/">Sequel Pro</a></li></ul><p>Now after full filling above requirements next thing is to install Valet.<br>So the following are the stages that have to do. 👇</p><h4>stage 1: Install Valet</h4><ol><li>update our brew install to make sure we have access to the latest repositories</li></ol><pre>$ brew update</pre><p>2. PHP7.2 installed as Valet required</p><pre>$ brew install php@7.2</pre><p>3. Using Composer, install Valet</p><pre>$ composer global require laravel/valet</pre><blockquote><em>You’re going to want to make sure that the valet command is globally accessible, so be sure to add ~/.composer/vendor/bin to your system’s “$PATH” by running export PATH=”$HOME/.composer/vendor/bin:$PATH”.</em></blockquote><p>4. Testing valet command is globally accessible</p><pre>$ valet</pre><p>5. Install valet</p><pre>$ valet install</pre><p>So after run above command Valet is installed! <br>It means that your computer is ready to host PHP sites and frameworks locally. :smiley:</p><h4>Stage 2: Create a Database</h4><p>if you have installed MySQL and GUI like SequelPro to manage your databases, it is fine you can create a database named w<em>ordPress</em> or whatever name you like. <br>or <br> If by chance you don’t have MySQL installed, run the following command. (<em>Your username will become ‘root’ and the password will be empty ‘ ‘)</em></p><pre>$ brew install mysql@5.7</pre><p>log in to MySQL:</p><pre>$ mysql -u root</pre><p>if password as use -p parameter to provide the password for MySQL login</p><p>then create a new database named ‘Wordpress’ or another name,</p><pre>mysql&gt; create database wordpress;<br>mysql&gt; quit;</pre><p>So the database will create successfully.</p><p>Then all is ready to install Wordpress. Let’s do it.</p><h4>Stage 3: Install WordPress</h4><pre>$ git clone https://github.com/WordPress/WordPress.git mysite<br>$ cd mysite</pre><p>The above command will clone the most recent version of WordPress and copy the files to a new folder called ‘mysite’.</p><p>Instead of <em>mysite</em> there you can replace it with your project name.</p><p><strong>Stage 4: Run Valet</strong></p><pre>$ valet link mysite</pre><p>This command will handle all of the DNS routings and create a custom URL for us to access the site. Notice that the last parameter is the value of our local domain.</p><p>When you visit <a href="http://mysite.test/">http://mysite.test</a>, you’ll see the WordPress installation page. Just follow the instructions to complete the installation.</p><p>So these are the steps for setup WordPress locally on your mac.</p><p>If you want to set up more wp sites you have to skip some steps like valet install, MySQL install.</p><p>you can follow the below steps to set up another WordPress site.</p><pre>1. Download WordPress into a new folder using the command line</pre><pre>2. Run <em>valet link</em> and set up the URL to access the folder</pre><pre>3. Install WordPress</pre><p>Thank you and happy WordPressing 👋</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d39ee1efdd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git Basics]]></title>
            <link>https://malisha.medium.com/git-basics-4b113d1de605?source=rss-c4197550f497------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b113d1de605</guid>
            <category><![CDATA[git-commands]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[gitflow]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Malisha Tharindu]]></dc:creator>
            <pubDate>Tue, 10 Mar 2020 07:18:47 GMT</pubDate>
            <atom:updated>2020-05-26T11:13:03.143Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UsDV3yGHu1lcxfvuvMbfWA.png" /></figure><blockquote><a href="https://git-scm.com/"><strong>Git</strong></a> is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.</blockquote><p>Git was developed by Linus Torvalds for managing Linux kernel developments.</p><p>Nowadays Git is widely used as a modern distributed version control system. This helps in tracking the changes done to code in a software project on its progress.</p><p>The following are the basic Git commands with the explanation that are heavily used.</p><p><strong>Setting up Git<br></strong>To set up Git to your pc you have to download the Git installation file from the below <a href="https://git-scm.com/">Git official site</a>. Then, follow the installation steps as you install Git using the installer. You can find more details about installing Git at <a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">https://git-scm.com/book/en/v2/Getting-Started-Installing-Git</a>. This document lists several ways of installing Git on various platforms.</p><p>After installation, you can following command to verify the success of the Git installation and Git version.</p><pre>git  --version</pre><p>once we verify git is installed we have to configure a couple of global identical parameter of the username and email as follows.</p><p>Open a cmd window or terminal on your computer and use following commands for configuration.</p><pre>git config --global user.name &quot;&lt;name&gt;&quot;</pre><p>This defines the author&#39;s name to be used for all commits in the current repo. Developers commonly use — <em>global </em>flag to set config option s for the current user.</p><pre>git config —-global user.email &lt;email &gt;</pre><p>To ensure this information has configured we can use the following command in cmd/terminal and see the information.</p><pre>git config —-list </pre><p>So this the way of setting up the git on our pc.</p><p><strong>Basic Git Commands</strong></p><h4>2. Git init</h4><pre>git init</pre><p>This creates empty Git repo in the specified directory.<br>Either you can place the repository name and it is not necessary.</p><pre>git init &lt;directory&gt;</pre><h4>3. Git Clone</h4><pre>git clone &lt;repo&gt;</pre><p>Clone repo located at &lt;repo&gt; onto local machine. Original repo can be located on the local filesystem or on a remote machine via HTTP or SSH.</p><p>So when you need to download the repository in the GitHub, this is the terminal that could be used.</p><pre>git clone &lt;repo url&gt;</pre><p>example: git clone <a href="https://github.com/malisha/react">https://github.com/malisha/musicReact</a>App.git</p><h4>4.Git status</h4><pre>git status</pre><p>This lists which file are staged, unstaged, and untracked. <br>In other words, this will list all the files that you have to commit before pushing them.</p><h4>5. Git Add</h4><p>you can use mainly two commands as your need.</p><pre>git add &lt;file&gt;</pre><p>you can add the files separately using this command.</p><p>if you want to add all files to a single commit use following <em>git add all</em> command</p><pre>git add <strong>.</strong></pre><p>Also you can</p><h4>6. Git Commit</h4><pre>git commit -m “&lt;message&gt;”</pre><p>This is the command that uses for committing the changes. <br>use &lt;message&gt; as the commit message</p><p>After doing commenting, again we can use <em>git state </em>to check whether the changes have been applied.</p><h4>7. Git Log</h4><pre>git log</pre><p>Display the entire commit history using the default format.</p><h4>8. Git Diff</h4><pre>git diff</pre><p>Show unstaged changes between your index and working directory.</p><h3>Git Undoing changes</h3><h4>1. Git Revert</h4><pre>git revert &lt;commit&gt;</pre><p>This creates a new commit that undoes all of the changes made in &lt;commit&gt;, that apply to the current branch.</p><h4>2. Git Reset</h4><pre>git reset &lt;file&gt;</pre><p>This removes &lt;file&gt; from the staging area, but leave the working directory unchanged. (this unstages a file without overwriting any changes )</p><h4>3. Git Clean</h4><pre>git clean -n</pre><p>Shows which file would be removed from the working directory.<br>To execute the clean you can use following git command</p><pre>git clean -f</pre><h3>Rewrite Git History</h3><h4>1. Git Commit — amend</h4><pre>git commit — amend</pre><p>This use for replacing the last commit with the staged changes and last commit combined. Use with nothing staged to edit the last commit’s message.</p><h4>2. Git Rebase</h4><pre>git rebase &lt;base&gt;</pre><p>Using this we can rebase the current branch onto &lt;base&gt;.<br>This &lt;base&gt; can be a commit ID, branch name, a tag or a relative reference to HEAD.</p><h4>3. Git Reflog</h4><pre>git reflog</pre><p>This shows a log of changes to the local repository&#39;s HEAD<br>To show date info use <strong><em>git reflog</em></strong> <strong><em>— relative -date</em></strong> flag<br>To show all the refs use <strong><em>git reflog — all</em></strong></p><h3>Git Branches</h3><h4>1. Git Branch</h4><pre>git branch</pre><p>List all the branches in your repo. <br>To create a new branch we can add &lt;brach &gt; with the name &lt;branch&gt; as the following command.</p><pre>git branch &lt;branch&gt;</pre><h4>2. Git Checkout</h4><pre>git checkout -b &lt;branch&gt;</pre><p>This command will create and check out a new branch named &lt;branch&gt;</p><p>Drop the <strong><em>-b</em></strong> flag to checkout an existing branch.</p><h4>3. Git Merge</h4><pre>git merge &lt;branch&gt;</pre><p>Merge &lt;brach&gt; into the current branch.</p><h3>Remote Repository</h3><h4>1. Git Remote Add</h4><pre>git remote add &lt;name&gt; &lt;url&gt;</pre><p>This creates a new connection to a remote repo. <br>&lt;name &gt; is used as a shortcut for &lt;url&gt; in other commands.</p><h4>2. git fetch</h4><pre>git fetch &lt;remote&gt; &lt;branch&gt;</pre><p>Fetches a specific &lt;branch&gt;</p><h4>3. Git Pull</h4><pre>git pull &lt;remote&gt;</pre><p>this fetches the specified remote’s copy of the current branch and immediately merges it into the local copy.</p><h4>4. Git Push</h4><pre>git push &lt;remote&gt;&lt;branch&gt;</pre><p>Use this command when you want to publish the local changes to the remote. So this pushes the branch to &lt;remote&gt;, along with necessary commits and objects. If there &lt;branch&gt; doesn&#39;t exit it will be created a branch named as &lt;branch&gt;</p><p>By default, the cloned repository has a remote link called ‘origin’. So use the ‘<strong><em>git push &lt;remoyte&gt; &lt;branch&gt;’ </em></strong>command in case you have multiple remotes and multiple branches (by default you can use the command <strong>‘<em>git push origin master</em>’</strong>).</p><p>Also ‘<strong><em>git push — all &lt;remote&gt;’ </em></strong>command can be used, when you need to push the changes in every branch to a given remote link.</p><h3>Connect it to GitHub</h3><p>To upload your local git repo to remote, we can use GitHub, BitBucket etc.</p><p>So this is how we can upload our project into GitHub.</p><ol><li>Go to <a href="https://github.com/">GitHub</a>.</li></ol><p>2. Log in to your account.</p><p>3. Click the <a href="https://github.com/new">new repository</a> button in the top-right.</p><p>4. Click the “Create repository” button.</p><p>To <strong>push</strong> an existing repository you can follow these commands by the opening terminal or cmd prompt in the root folder of the project.</p><pre>$ git remote add origin git@github.com:username/new_repo<br>$ git push -u origin master</pre><p>Actually, the first line of the instructions will say</p><pre>$ git remote add origin <a href="https://github.com/username/new_repo">https://github.com/username/new_repo</a></pre><p>But I use git@github.com:username/new_repo rather than https://github.com/username/new_repo, as the former is for use with <a href="https://en.wikipedia.org/wiki/Secure_Shell">ssh</a> (if you set up ssh as I mentioned in “<a href="https://kbroman.org/github_tutorial/pages/first_time.html">Your first time</a>”, then you won’t have to type your password every time you push things to Github). If you use the latter construction, you’ll have to type your Github password every time you push to GitHub.</p><p>Thank You :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b113d1de605" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>