teleren/devto huggingface dataset:
Advanced Git - Cheat Sheet
Published: 2020-06-03 02:21:40

# Advanced Git: Cheat Sheet

- [Advanced Git: Cheat Sheet](#advanced-git-cheat-sheet)
  - [Go To Previous Branch](#go-to-previous-branch)
  - [Get History](#get-history)
  - [Rollback Repo](#rollback-repo)
  - [Clean Repo](#clean-repo)
  - [See Differences Between Branch & Master](#see-differences-between-branch--master)
  - [Custom Commits](#custom-commits)
  - [Fixup](#fixup)
  - [Stash](#stash)
  - [Helpful Git Aliases](#helpful-git-aliases)

## Go To Previous Branch

`git checkout -`

## Get History

```bash
# Log in one line
git log --oneline

# Retrieve all commits by message
# Here all commit that contain 'homepage'
git log --all --grep='homepage'

# Retrieve all commit by author
git log --author="Maxence"

```

## Rollback Repo

```bash
# Get everything you did
git reflog

# then reset to the desired commit (i.e. HEAD@{4})
git reset HEAD@{4}
# ...or...
git reset --hard <commit-sha1>
```

## Clean Repo

```bash
git fetch origin
git checkout master
git reset --hard origin/master
# You're now up-to-date with master!
```

## See Differences Between Branch & Master

```bash
git diff master..my-branch
```

## Custom Commits

```bash
# Edit last commit
git commit --amend -m "A better message"

# Add something to the last commit without writing message again
git add . && git commit --amend --no-edit

# empty commit - can be useful to re-trigger CI build...
git commit --allow-empty -m "chore: re-trigger build"
```

## Fixup

```bash
git add .

git commit --fixup HEAD~1
# or replace HEAD~1 by the commit hash (fed14a4c)

git rebase -i HEAD~3 --autosquash
# save&quit the file (:wq in VI)
```

## Stash

```bash
# save all tracked files
git stash save "your message"

# list your stashes
git stash list

# retrieve stash and delete
git stash apply stash@{1}
git stash drop stash@{1}
# ... or in 1 command
git stash pop stash@{1}
```

## Helpful Git Aliases

```bash
alias g='git'
alias glog='git log --oneline --decorate --graph'
alias gst='git status'
alias gp='git push'
alias ga='git add'
alias gc='git commit -v'

# 🤘
alias yolo='git push --force'

# useful for daily stand-up
git-standup() {
    AUTHOR=${AUTHOR:="`git config user.name`"}

    since=yesterday
    if [[ $(date +%u) == 1 ]] ; then
        since="2 days ago"
    fi

    git log --all --since "$since" --oneline --author="$AUTHOR"
}
```
Reduce overhead for data serialization between Wasm & JS (Help!)
Tags: rust, webassembly, optimization, help
Published: 2020-06-03 01:48:13

---
title: Reduce overhead for data serialization between Wasm & JS (Help!)
published: true
description: 
tags: rust,wasm,optimization,help
//cover_image: https://direct_url_to_image.jpg
---


I am trying to export `Rust gif` library to js runtime by using `wasm` to get a high-performance gif encoding/decoding library ([repo](https://github.com/WenheLI/wasm-gif)). However, when running benchmarking, I found huge overhead for data serialization in the process (15ms for decoding & 300ms+ for data serialization).

Any ideas on how to address it, folks?
Help and discussion are appreciated 👍
react native state not updating
Tags: reactnative
Published: 2020-06-03 00:17:07

React native state not updating
Location in alert returns empty

function Home({ route, navigation }) {
  
  const [location, setLocation] = useState('');
  
  const _appStart = () => {
    _location();
  }

  const _location = () => {
    setLocation("Konum Ekle");
    alert(location);
  }

  React.useEffect(() => {
    const unsubscribe = navigation.addListener('focus', () => {
     _appStart();
    });

    return unsubscribe;
  }, [navigation]);

  return (
    <View style={styles.container}>
      <Text>{location}</Text>
    </View>
  )
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor:'#ffff',
  },
})

export default Home
What I’d tell my 12 yo self who just started coding 
Tags: Beginners, codenewbie
Published: 2020-06-03 00:03:15

 I made a small thread and I thought it might be helpful to some of you. 
I hope it is lol.
Let me know what yall think. Love you <3
https://twitter.com/seb_pob/status/1267955458872086531
Como tornar sua API express mais segura com Helmet
Tags: node, microservices, javascript, security
Published: 2020-06-03 00:00:02

Segurança é assunto sério! Você tem se preocupado com a segurança de suas APIs?

Quando se trata de APIs contruídas com Express.js, 1 passo simples pode ajudar você a aumentar o nível de segurança do seu sistema: a biblioteca **Helmet**.

![Helmet Website](https://dev-to-uploads.s3.amazonaws.com/i/cesrn3x1bp8g9q2b7c9r.png)

## Quem é Helmet?

Helmet é uma biblioteca para Express.js que agrega 12 middlewares simples, responsáveis por setar alguns headers nas respostas HTTP.

Vamos fazer um exemplo simples logo a seguir:

## Exemplo simples

```bash
$ mkdir my-api
$ cd my-api
$ npm init -y
$ npm install express --save
```

Crie um arquivo `index.js`:

```js
const express = require('express')

const app = express()

app.get('/', (request, response) => {
  return response.json({
    api: 'live'
  })
})

app.listen(3000)
```

Inicie o servidor:

```bash
$ node index.js
```

Perceba os headers retornados pela requisição sem o uso do helmet:

![Insomnia](https://dev-to-uploads.s3.amazonaws.com/i/7pdx2vs99uo8l7i4wtxa.png)

Vamos incluir o helmet em nossa API. Primeiro, faça a instalação do package:

```bash
$ npm install helmet --save
```

Importe e inclua no app express da seguinte forma:

```js
const express = require('express')
const helmet = require('helmet')

const app = express()

app.use(helmet())

app.get('/', (request, response) => {
  return response.json({
    api: 'live'
  })
})

app.listen(3000)
```

Reinicie o servidor:

```bash
$ node index.js
```

Conheça os novos headers setados pelo helmet:

![Insomnia](https://dev-to-uploads.s3.amazonaws.com/i/20e8l2uyndlpcyly21ar.png)

Esses headers adicionam o nível a mais de segurança em sua API. Como por exemplo o `Strict-Transport-Security`, que permite que um site informe aos navegadores que ele deve ser acessado apenas por HTTPS, em vez de usar HTTP.

Alguns middlewares vêm ativados por padrão, outros não. Saiba mais em https://helmetjs.github.io/

Até a próxima!
Creating a Web Application using Deno
Tags: deno
Published: 2020-09-10 05:49:37

---
title: Creating a Web Application using Deno
published: true
date: 2020-06-03 00:00:00 UTC
tags: Deno
canonical_url: https://www.loginradius.com/engineering/blog/a-webapp-in-deno/
---

Hello, let's create a simple web app using deno, In this blog, I will be using the Deno Third-Party Module called `abc` for creating a simple web application. I am assuming that you are familiar with the basic setup of deno. If not you can start with basic deno installation from…

   
[Read On](https://www.loginradius.com/engineering/blog/a-webapp-in-deno/)
TestFlight Review Times
Tags: swift, apple, ios, testflight
Published: 2020-06-11 12:04:34

---
title: TestFlight Review Times
published: true
date: 2020-06-03 00:00:00 UTC
tags: swift, apple, iOS, TestFlight
canonical_url: https://blog.rizwan.dev/blog/test-flight-review-times
---

If you ever submitted an app update recently to TestFlight review on App Store Connect, you know the time take to get it approved. It was the case for even App Store app updates some time back. Recently Apple is improving the total time taken for review resulting in one day review time (some developers from US time zone can get even less then an hour)

At my work, we do have multiple beta groups and most of the time a new update would take more then 2 days to get it reviewed for TestFlight. Its doesn’t work for urgent release. So we changed the release process little bit different and always keep the TestFlight app updates near instant.  
  
The way TestFlight update works is every new version update has to go to review and every build on the same version is apporved immediately.

So whenever we released a version to App Store, immediately we submit the same build again for TestFlight app review by bumping the version number. By the time we finish developing the app update, the initial version submitted to review would be approved and submitting second build on same version would get approved immediately.

For example, after releasing v5.0 to App Store, try submitting v5.1 (or whatever version on your pipeline) with the same build as v5.0. Only change here is version number. By the time you actually wants to push v5.1 for your beta testers. Just bump the build number and submit. It will be approved immediately.

[![TestFlight Review Time Process](https://blog.rizwan.dev/static/cb1a6f8cb921c9165dfd1abd739562c1/3c024/test-flight-review-diagram.png "TestFlight Review Time Process")](/static/cb1a6f8cb921c9165dfd1abd739562c1/3c024/test-flight-review-diagram.png)

> Above works fine as of dated. Who knows WWDC 2020 might have some improvements.
Building, Training, Testing and Deploying ML Models in May 
Tags: machinelearning, datascience, python, jupyter
Published: 2020-06-02 23:37:46

In the month of May my colleague Jenna Ritten (@jritten) and I decided to do a series on building,  training, testing and deploying AI/ML models! This series showed users how to use Watson Studio which is an interactive, collaborative, cloud-based environment where data scientists can use multiple tools to activate their insights. 

The goal of this series was to show the various tools that can be used within Watson Studio such as Visual  Recognition, Natural Language Classifier , Auto AI and  Juypter Notebooks. With this series we wanted to empower new and experienced data scientists with the knowledge and ability to train and deploy models in an effective and collaborative way.  

**If you missed our series check out these resources and the replay to each event :** 

## Part 1 : Building and Deploying Models w/ Visual Recognition and Natural Language Classifier
![](https://paper-attachments.dropbox.com/s_893F271144B755F76E33AD2C2BC3F0B868A76F46D15DEB5DF5D9EB5939442212_1591139483491_Screen+Shot+2020-06-02+at+7.10.40+PM.png)


**Check out the full replay of event here :**
https://developer.ibm.com/events/ai-ml-masterclass-part-1-building-and-deploying-models-w-visual-recognition-and-natural-language-classifier/

**Slides for event :** https://slides.com/poojamistry/custommodels#/

**Workshop :** 

- [ibm.biz/visrecworkshop](https://watson-workshops.gitbook.io/visual-recognition/)
- [ibm.biz/nlcworkshop](https://github.com/IBM/nlc-email-phishing)


##  Part 2 : Building and Deploying models with AutoAI
![](https://paper-attachments.dropbox.com/s_893F271144B755F76E33AD2C2BC3F0B868A76F46D15DEB5DF5D9EB5939442212_1591139792627_Screen+Shot+2020-06-02+at+7.16.01+PM.png)


**Check out the full replay of event here :** https://developer.ibm.com/events/ai-ml-masterclass-part-2-building-and-deploying-models-with-autoai/

**Slides for the event :** http://ibm.biz/wsmasterclassautoai_slides

**Workshop :** https://github.com/IBM-Developer-Austin/autoai


## Part 3 : Building and Deploying models with Jupyter Notebooks


![](https://paper-attachments.dropbox.com/s_893F271144B755F76E33AD2C2BC3F0B868A76F46D15DEB5DF5D9EB5939442212_1591140286882_Screen+Shot+2020-06-02+at+7.24.35+PM.png)


**Check out the full replay of event here :**  https://developer.ibm.com/events/ai-ml-masterclass-part-3-building-and-deploying-models-with-jupyter-notebooks/

**Slides for the event :** https://slides.com/poojamistry/jupyternotebooks#/

**Workshop :** [ibm.biz/jupyterworkshop](https://github.com/pmmistry/intro-to-jupyter-notebooks)


[Register for IBM Cloud](https://cloud.ibm.com/registration?target=%2Fcatalog) to get started with Watson Studio! Make sure you check out [IBM Developer](https://developer.ibm.com/) for more resources, tutorials, blogs, code patterns and content in the AI/ML Space! 

I hope this blog helps you as you begin your AI/ML journey ! Give me a follow if you like this post, or follow me on Twitter [@poojamakes](https://twitter.com/poojamakes) to see what other webinar series I will be teaching next!🙂
100daysofcode Flutter
Tags: 100daysofcode
Published: 2020-06-02 23:09:31

day 86/100 of #100daysofcode #Flutter
Learning Flutter , courses Udemy from
@maxedapps

Today learn Auth firebase, set extra data, implements loading spinner,implements onAuthStatChange,
https://github.com/triyono777/100-days-of-code/blob/master/log.md
Day 145 : This is America
Tags: hiphop, code, coding, lifelongdev
Published: 2020-06-02 22:55:24

_liner notes_:
- Professional : Finished up some research for work. Planning out the workshop I'll be giving next week. With everything going on, kind of difficult to focus.

- Personal : Did some work on a side project. Enough on that, amazing that a peaceful demonstration to protest abuse of power is met with force, flash bombs, pepper spray and people in riot gear so that the president could do a photo shoot in front of church holding a Bible that no one actually believes he cares about either. Amazing! This is America in 2020.

![Overhead view of the rocky coast of Sangres, Portugal](https://dev-to-uploads.s3.amazonaws.com/i/5cquttv8h8qzm73e8f7k.png)

Will keep working on my side project and then go to sleep.

Have a great night! Be safe.

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube VYOjWnS4cMY %}
C8 a native V8 code-coverage
Tags: node, testing, javascript
Published: 2020-06-02 22:51:18

Originally created by [Benjamin E. Coe](https://github.com/bcoe) one of the maintainers of [istanbul](https://istanbul.js.org/), is based on  code-coverage using [Node.js' built in functionality](https://nodejs.org/dist/latest-v10.x/docs/api/cli.html#cli_node_v8_coverage_dir) that's compatible with Istanbul's reporters, with 100k of downloads on **npm**, it's an awesome alternative for the most popular command line tool for instrumenting code coverage [nyc](https://github.com/istanbuljs/nyc).

Like **nyc**, **c8** just magically works:
```bash
yarn global add c8
c8 node xpto.js
```
# But why did you use this c8 instead of nyc? 🤨
First of all i will clarify about my motivation 🤔

I've been working on a project in node.js, using mocha and chai for the tests, this project uses [esm](https://www.npmjs.com/package/esm) and because of this I had some problems with nyc, he couldn't identify the files and raise the coverage of each one, I followed what the community recommended and nothing, my tech lead (a.k.a mister Snack) suggested refactoring all `import a from 'a'` to `const a = require('a')`, however, I didn't want to have all this work 😅

So I looked for some alternative and discovered the c8, that I could generate the reporters in the same way as I would with nyc, and because it is based on V8's built in coverage

It's a great tool, and here's the tip if you want to try a new technology.

You can see more about c8 [here](https://www.npmjs.com/package/c8).
{% github https://github.com/bcoe/c8 no-readme %}
🍻
The Legend of Data - Ep.1 - Introduciton to Jupyter notebook
Tags: datascience, python, beginners, tutorial
Published: 2020-06-02 22:32:01

---
title: The Legend of Data - Ep.1 - Introduciton to Jupyter notebook
published: true
description: Jupyter notebook is one of the most popular IDE for data scientists. As the first episode of this new data science series, we will have an introduction to this open-source tool, how it works and how to use it efficiently. We also talked about what we will cover in the upcoming tutorials in this series.
tags: data science, python , beginner, tutorial
---
Jupyter notebook is one of the most popular IDE for data scientists. As the first episode of this new data science series, we will have an introduction to this open-source tool, how it works and how to use it efficiently. We also talked about what we will cover in the upcoming tutorials in this series. If you have any questions or any suggestions about which Python or Data Science topics to cover, please leave your comment at my [Twitch channel](https://www.twitch.tv/cheukting_ho)

You can get the slide deck [here](https://slides.com/cheukting_ho/legend-data-intro/).
Black Lives Matter
Tags: blacklivesmatter
Published: 2020-06-02 22:28:10

---
title: Black Lives Matter
published: true
description: Statement from the founder of The Collab Lab on recent events around the United States.
tags: blacklivesmatter
cover_image: https://blacklivesmatter.com/wp-content/uploads/2020/05/blmgn-slider-rest-in-power-beautiful-052920-2000x1125-01-1024x576.jpg
---

_I published a post to The Collab Lab’s internal Slack team on Sunday, but considering the events of the last couple of days wanted to take the step of taking the message public. It’s nothing profound, simply an expression of support for the amazing people who contribute to and take part in the programs of our little nonprofit._

_To make it fully explicit, we at The Collab Lab believe that **Black lives matter.** We strive to be **anti-racist.** We acknowledge the many ways that **privilege has benefited many of us.** We are committed to doing everything we can to lift up the people who come to Collab Lab looking for that next bit of experience that might mean the difference between finding that foothold in tech or not._

_If you have the means, **consider donating to organizations fighting for justice for Black people.** You can also educate yourself, patronize Black-owned businesses, etc. Here is [an excellent compilation of aligned organizations and businesses](https://docs.google.com/document/d/1zh6reFJWkZRGBL5iIezTfA2tkKBB3X9JcMh2QYT8tWk/preview?pru=AAABcpsr_BY*BwhI8dyHiBfNnQQXP9BZIg)._

`@channel` I just wanted to take a minute to acknowledge what’s going on in the world at the moment. I was born 17 days after Dr MLK, Jr was assassinated. That summer of ’68 saw massive protests including surrounding the Democratic National Convention. Yep, like 2020, 1968 was also an election year and Richard Nixon ended up being elected President. :neutral_face:

So little has changed in the last 50 years, I feel more sad and disappointed with my country than I ever have. As if the pandemic wasn’t enough, we’re seeing (mostly) peaceful uprisings by the American people being violently suppressed by police who have transformed themselves into armed militias and are acting not to serve and protect, but to destroy and intimidate.

Kareem Abdul-Jabbar (former NBA star for the LA Lakers) started life as Lew Alcindor and changed his name partly as a result of the unrest in the late 1960s. He’s written [an incredibly thoughtful piece](https://www.latimes.com/opinion/story/2020-05-30/dont-understand-the-protests-what-youre-seeing-is-people-pushed-to-the-edge) that might be helpful in putting some context around what is going on.

I know many of you are feeling a ton of strong and probably at times contradictory feelings about everything happening in the US and the world at the moment. The Collab Lab is a community and we will do everything we can to support each other through all of this.

We exist to right inequities in the tech industry. I see that as directly connected to the larger issues of social justice that are playing out right now on our screens and in some cases in front of our houses.

Be safe. Be strong. No justice, no peace. :fist:
Making AWS Amplify work with Rollup
Tags: aws, amplify, rollup, javascript
Published: 2020-06-02 22:22:28

---
title: Making AWS Amplify work with Rollup
published: true
description: AWS Amplify assumes CommonJS, which Rollup is allergic to. I recently discovered that you can make it work with Rollup with a few tweaks.
tags: AWS, Amplify, Rollup, JavaScript
---

AWS Amplify assumes CommonJS, which Rollup doesn't work well with (Hence all Amplify web app examples use Webpack). I recently discovered that you can make it work with Rollup with a few tweaks.

Let's take the default Svelte app, which uses Rollup:

```bash
npx degit sveltejs/template my-svelte-project
cd my-svelte-project
npm install
```

This default rollup template lacks just two things you need to use Amplify with Rollup. Install `@rollup/plugin-json`:

```bash
npm i -D @rollup/plugin-json
```

And add it to your `rollup.config.js`. Also set the `node-resolve` plugin's `preferBuiltins` option to false:

```js
import resolve from "@rollup/plugin-node-resolve";
import json from "@rollup/plugin-json"; // new!

export default {
  // ...
  plugins: [
    // ...
    resolve({
      browser: true,
      preferBuiltins: false, // new!
      dedupe: ["svelte"],
    }),
    json(),                  // new!
    // ...
  ]
}
```

And now you are done!

This setup will work fine with Amplify. For a full demo adding a full Amplify CRUD backend to a working Svelte frontend in under 30 mins, check out [my recent practice run here](https://www.youtube.com/watch?v=hCoRYc_FzK0&feature=youtu.be)!

Dev.to Embed: {% youtube hCoRYc_FzK0 %}
Making cron jobs fun again: a tool for simple recurring tasks
Tags: node, javascript, showdev, productivity
Published: 2020-06-02 22:20:31

Recently, a buddy and I built a [little tool](https://www.gettaro.com/) that makes it super easy to deploy and monitor simple recurring jobs in NodeJS.

![Demo](https://dev-to-uploads.s3.amazonaws.com/i/ymjgmqw4onpsrmy8x3w3.png)

**Why is this useful?**

As developers, every now and then we come up with cool ideas of things to automate. I remember a few years back when I first started learning how to code and was looking for an apartment in San Francisco, I felt like the world’s cleverest hacker when I set up a script to email every new listing on CraigsList in the neighborhoods I was interested in living in. (This had some disastrous consequences, but that’s a story for another time.)

My only problem at the time was that I would have to manually run this script myself every day.

Now, as a more experienced developer, I know enough to know that one approach to this problem is to set up a cron job, or something similar. Recently I found myself wanting to do this again… but every time I want to do it, it takes some effort to remind myself how it all works. At first I thought, maybe I’m just an idiot. But after talking to a few friends, we realized that a bunch of us have the exact same issue.

So we figured, why not build a little tool that makes this process extremely simple? This is what led to the creation of Taro: https://www.gettaro.com/

![Screenshot](https://www.gettaro.com/assets/screenshot.png)

We'd love to hear the community's thoughts on integrations that would be particularly useful (e.g. alerting with SMS, lightweight storage, etc) as we continue to hack on this!

*(P.S. If you're looking for examples of scripts to run with something like this, I put together a little list of [examples here](https://medium.com/@reichertjalex/taro-making-cron-jobs-fun-again-dbf9c34b72e)!)*