teleren/devto huggingface dataset:
Let's Encrypt with Let's Encrypt
Tags: ssl, customdomain, webdev, parseserver
Published: 2019-10-25 11:20:06

Imagine if there was a way to set up SSL on your website in just one click. How cool would that be? Well with SashiDo and Let's Encrypt now you can easily achieve it!

[Let’s Encrypt](https://letsencrypt.org/about/) is a free, automated, and open certificate authority (CA), run for the public’s benefit, and it is a one-click option for your web app hosted on SashiDo. They let people and organizations around the world obtain, renew, and manage SSL/TLS certificates. Their certificates can be used by websites to enable secure HTTPS connections.

We, at SashiDo, love what they are doing so we decided to give you an easy way to use their services when you use a custom domain name with your app in SashiDo.
You can activate your Let's Encrypt certificate through your app dashboard -> App Settings -> Emails & Hosting. 

![](https://media-blog.sashido.io/content/images/2017/03/lets-encrypt-1.png)

Let's Encrypt believes in and encourages automating as much as possible in system administrative work, so do we. That's why once you enable your certificate, we renew it when necessary, so you no longer have to worry about your SSL certificate anymore. 

You can check Let's Encrypt [FAQ page](https://letsencrypt.org/docs/faq/) for any questions regarding their certificates or contact us at support@sashido.io or via our live chat. We will be happy to answer all your questions.

Happy coding :)
Static web hosting with SashiDo
Tags: webhosting, tutorial, beginners, webdev
Published: 2019-10-25 11:08:03

One of the guideline policies that Parse created was to try to make everything convenient for its users and that was one of the main reasons developers loved the service. **SashiDo’s team wants to keep this tradition by providing our customers with the same experience of comfort and effortless coding**. I’m sure this happened to you: you get an order for an app, but the customer also wants a website with it. So you have to use one provider for the mobile application, another for the website, deal with web hosting and sftp servers, domain name registering etc. Wouldn’t it be lovely to have everything in one place? 

#### With SashiDo you can :)


In this tutorial, we’ll show you how to **publish static web sites in a few simple steps**. 
When you deploy Cloud Code in your GitHub repo, any files in your directory ‘public’ is uploaded to Parse Server and becomes accessible online. You can choose a subdomain in their app settings.

So let’s get started. 

- Go to SashiDo’s Dashboard  > App Settings > Emails & Hosting . Choose a subdomain name, it should be in the following format: 

    **[subdomain-name].yoursite.com**

- Enter the wanted subdomain + mysite.com in the input, don’t press ‘Save changes’ yet. 
* By entering the subdomain’s name you’ll see hostnames to resolve the CNAME.


![](https://media-blog.sashido.io/content/images/2016/10/1.jpg)

 - Now you have to claim the new hostname. Go to your DNS provider and set up a new CNAME record. 
 - Go back to SashiDo’s Dashboard and now save the changes. 
 - You already know about your private GitHub repo with your Cloud Code hosted in it [link to tutorial](https://blog.sashido.io/how-to-set-up-cloud-code-on-sashido/). It also holds a folder named ‘public’ where you can keep your html, css, JavaScript, image files. 
 - Clone the repository and
```
git add .
git commit -am 'upload my awesome site'
git push
```

 your website files in the ‘public’ directory. Every push triggers a deploy so you don’t have to deploy the code afterward :) 

 - Now go to your new domain and see how the website just came alive for the web. 

![alt](https://media-blog.sashido.io/content/images/2016/10/2.jpg)

Here’s some useful documentation on how to add new CNAME record: 

[GoDaddy](https://uk.godaddy.com/help/add-a-cname-record-19236)<br>
[Amazon](http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html)<br>
[namecheap](https://www.namecheap.com/support/knowledgebase/article.aspx/9646/10/how-can-i-set-up-a-cname-record-for-my-domain)<br>
[networksolutions](http://www.networksolutions.com/support/cname-records-host-aliases/)

Continue enjoying simple and straight-forward coding, leave the messy server-side stuff to us to handle :) 

We can’t wait to see the amazing sites you’ll create and host on SashiDo. 


Happy coding :)
Building complex interfaces with Stripe Elements
Tags: showdev, design, stripe
Published: 2019-11-13 11:53:21

---
title: Building complex interfaces with Stripe Elements
published: true
date: 2019-10-25 11:03:02 UTC
tags: showdev, design, stripe
canonical_url: https://miguelpiedrafita.com/stripe-elements-card/
---

It all started with a Tweet by [Muhammed Erdem](https://mobile.twitter.com/imuhammederdem) where he showcased a cool credit card form he had designed on Codepen:

{% tweet 1186335420327645184 %}

I was using the standard Stripe Element input (pictured below) and challenged myseld to implement the above design into a real application.

![Default input for Stripe Elements](https://miguelpiedrafita.com/content/images/2019/10/1_hCElNJcbkaTJ9cRQu_NveQ--1-.png)<figcaption>Default input for <a href="https://miguelpiedrafita.com/stripe-elements-card/stripe.com/elements">Stripe Elements</a></figcaption>

I started by copying the styles for the card and moving the Vue code to a single file component (Card.vue). After getting the original code working on [Sitesauce](https://sitesauce.app) I noticed the first problem: the code was using regular inputs to capture the credit card details and show them in the card while I needed to use Stripe Elements to be able to process payments to that card.

After digging through Stripe's documentation I found that just as there was a Card element that encapsulated the card number, expiry date and CVC code there were individual CardNumber, CardExpiry and CardCvc elements that I could use.

My solution consisted on adding the inputs directly on the card. This involved updating the styling both on the card and on the elements (which you can do with the style & class options when creating it).

```js
const cardNumber = elements.create('cardNumber', {
    classes: {
        base: 'card-item__number',
        focus: 'card-item__focus',
    },
    style: {
        base: {
            color: '#ffffff',
            lineHeight: '1',
            fontFamily: '"Source Code Pro", monospace',
            fontSmoothing: 'antialiased',
            fontSize: '27px',
            fontWeight: "500",
            '::placeholder': {
                color: '#cbd5e0'
            }
        },
        invalid: {
            color: '#fa755a',
            iconColor: '#fa755a'
        }
    }
})
```

I also updated the logic for detecting the card brand to rely on Stripe (which I assume is more accurate and also means I have less code to maintain) and added automatic focus to make the input more intuitive, and ended up with a really cool result.

{% tweet 1187478918967640064 %}
<figcaption>A video of the interface I ended up with</figcaption>
What do you think best way to learn ARDUINO programming. 
Tags: beginners, intro, discuss, productivity
Published: 2019-10-25 10:51:45

Imo, the best way to learn anything is by practicle approach. Same goes for arduino. 

Gather some arduino UNO, Nano boards.(You don't need to get original ones from their website. Just buy some clones[Remember: to read customer reviews.]). Learn the very basics on C language(Variables, Functions, Data types, Conditional handling, Loops are enough) . 

Then choose a small project(Like blinking an LED) . Mark down a rough sketch(Inputs, Outputs, Values, Shortened notes about sensors). Afterall write the program using Arduino - Programming Reference. BOOYAAH! Test it. If problem occurs, Google it. Always think something new, Be creative, See other projects, Analyse the code. Happy building 😊.
How to set up Cloud Code  on SashiDo
Tags: beginners, tutorial, github, cloudcode
Published: 2019-10-25 10:48:23

Cloud Code is one of the coolest features of Parse, **but we take it even to the next level ;)** You loved it and we love to make you happy so we decided to make the easiest possible way to set up your Cloud Code!

After you create/migrate your app you have to set up your Cloud Code in order to use it.


First select the app you want to work on:
![](https://media-blog.sashido.io/content/images/2016/07/1.png)


Go to Core -> Cloud Code -> press “Connect your account to GitHub”

![](https://media-blog.sashido.io/content/images/2016/07/2.png)



After a few seconds, the service will ask for your username and pass for GitHub (if you’re not logged in yet). A window will show up with the option to connect your GitHub account to SashiDo. 
Afterward, press the  button “Start your Cloud Code ”:


![](https://media-blog.sashido.io/content/images/2016/07/3.png)

We’ll automatically create a private GitHub repo for you, how cool is that :)

![](https://media-blog.sashido.io/content/images/2016/07/private_repo-3.png)
**Yes, we’re the only ones who give a private GitHub repo for each app :)**

As developers we use GitHub all the time - to collaborate, to manage and deploy our code. We think it’s one of the most convenient tools and **we’ve decided to integrate our platform with GitHub to ease your job.**

Soon you’ll see your Cloud Code in the dashboard.

Now you have fast and easy access to this awesome feature! 

**IMPORTANT!** Note that you should have a folder “cloud” with a file “main.js” inside in order to have working functionality and to see your Cloud Code in the dashboard. 

*You can find more useful info about your new repo’s possibilities in the file “README.md”.*

If you experience any kind of troubles during setup - contact us at support@sashido.io. We’re always ready to help :)
Doubts related to Django and Django Rest Framework 
Tags: discuss, django, webdev
Published: 2019-10-25 10:47:43

hi all,

This is my first question and here it is, i want to learn Django and i have started to build a web page. 

First question : why it is not considered as Front-end language ? It is considered as back-end language  while we can a build a web page where users can interact.

Second question: Now i came across Django Rest framework Which is quite popular. Why do i need to learn DRF ? what are the advantages ?

third : Now i am thinking  that it is possible to build a frontend and backend mixed web-app using Django, Right? Then why do we need Angular/React/Vue ??

Thanks in advance :)
How to Change Key Bindings of vim-mode-plus
Tags: vim, atom
Published: 2019-10-25 10:36:55

vim-mode-plus, which is a plugin for Atom editor doesn't have a feature to load vimrc files that are common in Vim editor. Therefore, we need to prepare keymap.cson, which is the keymap configuration file of Atom and init.coffee, which is an initial configuration file of Atom, to assign multiple commands to one command.

I will introduce an example that converts a vimrc file to init.coffee and keymap.cson.

### Before Conversion

#### vimrc

```text
noremap j gj
noremap k gk

noremap <S-j> 10j
noremap <S-k> 10k
noremap <S-h> 10h
noremap <S-l> 10l
```

### After Conversion

#### init.coffee

```coffeescript
atom.commands.add 'atom-text-editor.vim-mode-plus', 'custom:move-left-10', ->
  view = atom.views.getView atom.workspace.getActiveTextEditor()
  atom.commands.dispatch view, 'vim-mode-plus:set-count-1'
  atom.commands.dispatch view, 'vim-mode-plus:set-count-0'
  atom.commands.dispatch view, 'vim-mode-plus:move-left'

atom.commands.add 'atom-text-editor.vim-mode-plus', 'custom:move-down-screen-10', ->
  view = atom.views.getView atom.workspace.getActiveTextEditor()
  atom.commands.dispatch view, 'vim-mode-plus:set-count-1'
  atom.commands.dispatch view, 'vim-mode-plus:set-count-0'
  atom.commands.dispatch view, 'vim-mode-plus:move-down-screen'

atom.commands.add 'atom-text-editor.vim-mode-plus', 'custom:move-up-screen-10', ->
  view = atom.views.getView atom.workspace.getActiveTextEditor()
  atom.commands.dispatch view, 'vim-mode-plus:set-count-1'
  atom.commands.dispatch view, 'vim-mode-plus:set-count-0'
  atom.commands.dispatch view, 'vim-mode-plus:move-up-screen'

atom.commands.add 'atom-text-editor.vim-mode-plus', 'custom:move-right-10', ->
  view = atom.views.getView atom.workspace.getActiveTextEditor()
  atom.commands.dispatch view, 'vim-mode-plus:set-count-1'
  atom.commands.dispatch view, 'vim-mode-plus:set-count-0'
  atom.commands.dispatch view, 'vim-mode-plus:move-right'
```

#### keymap.cson

```text
'atom-text-editor.vim-mode-plus:not(.insert-mode)':
  'shift-h': 'custom:move-left-10'
  'shift-j': 'custom:move-down-screen-10'
  'shift-k': 'custom:move-up-screen-10'
  'shift-l': 'custom:move-right-10'
  'h': 'vim-mode-plus:move-left'
  'j': 'vim-mode-plus:move-down-screen'
  'k': 'vim-mode-plus:move-up-screen'
  'l': 'vim-mode-plus:move-right'
```
How to Set Up Vim Key Bindings in Atom
Tags: atom, vim
Published: 2019-10-25 10:31:31

I have been using Vim editor since I was a university student. However I start to think that Atom editor which has various plugins is more convenient in many cases.

To migrate from Vim to Atom smoothly, I've researched how to configure Vim key bindings in Atom.

### Install Plugins

vim-mode-plus and ex-mode are recommended.

Note: vim-mode and vim-mode-plus-ex-mode are deprecated.

- https://atom.io/packages/vim-mode
- https://atom.io/packages/vim-mode-plus-ex-mode

### Turn off IME when exit the insert mode with Esc

We need to use several 3rd party applications to change the key bindings because Atom plugins can not turn off IME.
- Karabiner (for MacOS) or AutoHotKey (for Windows) seem to be popular.
	(However, these applications cannot reset IME when we enter the insert mode again.)

### Configure key bindings for plugins

- You need to define key bindings in keymap.cson as vim-mode-plus doesn't have a feature to load vimrc files.
- If you need to issue multiple commands in a key binding, you need to register a custom command in init.coffee.
How to access MySQL DB behind two ssh host using MySQL Workbench
Tags: ssh, mysql, windows
Published: 2019-10-25 10:31:15

---
title: How to access MySQL DB behind two ssh host using MySQL Workbench
published: true
description: 
tags: SSH, MySQL, Windows
---

If you have a server infrastructure like following:

```
[Win dev machine] <=ssh=> [Gangway Server] <=ssh=> [App Server] <--> [MySQL DB]
```

We can access DB via SSH Tunnel, following these steps:

1. Using [Git Bash](https://www.atlassian.com/git/tutorials/git-bash) or [OpenSSH client for Windows 10](https://winaero.com/blog/enable-openssh-client-windows-10/), invoke command:
    
    ```shell
    ssh user_id@Gangway_Server -L 2202:App_Server:22 -N
    ```
    after typing the login password of user_id of Gangway Server, leave this terminal window opened.
![SSH Tunnel](https://thepracticaldev.s3.amazonaws.com/i/23oik1w7allk5o1a6bbo.png)   
2. Open MySQL Workbench, create connection using **Stand TCP/IP over SSH**, other settings like this screenshot:  
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/lpksl50dkhsdrsf2mm73.png)

After everything is done, close MySQL Workbench before closing the Terminal Window.
Ethereum Rust TESTS
Published: 2019-10-25 10:20:29

    import random
    perfecttiming = []
    for nonce in range(0,10000000):
        x = random.randint(10000000, 10000000000)  # 10 milyon ile 10 milyar arasında rastgele sayı üretir.
        y = x % 5760
        if y == 0:
            print("finally i found")
            perfecttiming.append(nonce)
            continue
            #break
        else:
            print(nonce, ":",y)
            continue

    print(perfecttiming)
    a = 0
    for x in perfecttiming:
        a = a + x

    print(x/len(perfecttiming))
Setup auto-renewable subscriptions for iOS in Flutter
Tags: flutter, inapppurchase, ios, mobile
Published: 2020-01-07 19:12:06

---
title: Setup auto-renewable subscriptions for iOS in Flutter
published: true
date: 2019-10-25 10:06:51 UTC
tags: flutter,in-app-purchase,ios,mobile
canonical_url: 
---

After I had successfully tested and implemented auto-renewable subscriptions on my Android APP… it was time to do the same thing for iOS… but once again… a problem came up.

When I was trying to list my past purchases, on iOS I was receiving an empty list… I won’t write about a full implementation of in-app purchases in Flutter as I’m only interested in this specific problem… you can get a good tutorial from [Fireship.io](https://fireship.io/lessons/flutter-inapp-purchases/).

The thing is, on iOS, you need to call **completePurchase()** in **purchaseUpdatedStream.listen** … just before you complete a purchase _(yeah)_… something like this

```
InAppPurchaseConnection.instance.purchaseUpdatedStream.listen((purchases) {
 purchases.forEach((purchase){
 if (purchase.status == PurchaseStatus.purchased) {
 if (Platform.isIOS) {
 InAppPurchaseConnection._instance_.completePurchase(purchase);
 }
 }
}
```

If you are following the tutorial from [Fireship.io](https://fireship.io/lessons/flutter-inapp-purchases/)… I’ve added that call inside **\_verifyPurchase().** They added the **completePurchase** call in **\_getPastPurchases()** but nothing happens if you call from there because you are going to receive always an empty list of past purchases if you don’t “confirm”.
Travis: Unable to Evaluate Symlinks in Dockerfile path
Tags: travis, docker
Published: 2019-10-25 10:01:08

---
title: Travis: Unable to Evaluate Symlinks in Dockerfile path
published: true
description: Notes on fixing "Unable to Evaluate Symlinks in Dockerfile path" error in travis build.
tags: travis, docker
---

I was following some Docker/Kubernetes tutorial some time back, and all was bright and good until it wasn't. Travis was failing with the error "unable to prepare context: unable to evaluate symlinks in Dockerfile path" and the script causing the build to fail look like this:
`docker build -t [secure]/client-test -f client/Dockerfile.dev ./client`

It was weird to me because I just used the same command to build and tag the docker image locally, so I tried, again and again to replicate on local - but local worked every damn time.

Now, in most cases when this error happens, it is caused by a wrongly typed folder/file name, or an incorrect file reference, and you can just double-check to get it fixed. But this case was different!

## What really happened? Submodules!

I removed the script instruction that was the culprit and watched the logs till I found something interesting, building the particular image for production was failing too, but all others were passing. At this point, it was becoming clear that my headache might have been caused by something around symlinks or so (it should have hit me from the error message anyway but *e dey happen*). I went back to Github, mindlessly looking at the repo and noticed this:

![Github screenshot](https://thepracticaldev.s3.amazonaws.com/i/qz6k8q4dm653v7ujmt29.png)

Ha! My fear was confirmed!

### What are Submodules again?
Sub-module is Git's way of enabling you keep a git repository within another while maintaining their commit history separately. It's like having a project within a project. Gitbook has a quite [solid explanation] (https://git-scm.com/book/en/v2/Git-Tools-Submodules) on how it works.

### So here is how it happened:
`create-react-app` automatically generated a git repository when it created the application (the client folder in this case), and I only initialized the repo on the parent folder after creating this react app. Somehow, the inner client directory (the react app) then became a submodule, and my naive self thought that deleting the `.git` folder in that inner folder was enough to get me a smooth ride.

## The fix.

Fixing it is as simple as removing the submodule and re-adding the folder to your staging like so:

```bash
# delete the submodule reference
git rm --cached submodule_path

# remove the inner .git dir if it still exists
rm -rf submodule_path/.git

# re-add the directory to the main repository
git add submodule_path

# commit and profit
git commit -m "removed git submodule"
```

and that is all.
How Opencart Purpletree Option Images and Color Swatches Extension work?
Tags: optionimages, opencartcoloroptions, colorswatchextension, opencartcolourswatches
Published: 2019-10-25 10:00:25

By using Purpletree Opencart color swatches you can generate the color and image swatches to display the available product attributes like colors, sizes, images, styles, checkboxes, dropdown, etc. You can replace the drop-down fields with color and image swatches.
Features:-
· Option to show swatches on the product page.
· Option to create swatches using Radio/dropdown Buttons.
· Option o add the different images for the product options.
· Option to create swatches using color.
· Option to set the minimum number of attributes to show on Shop Page.
· Option to create swatches using colors.
· Option to create swatches using images.
· Option to create swatches using icons
· Option to create swatches using text.
· Option to change Swatch border style in the circle or square shape.
· Option to set the attribute term label font size and font-weight.
· Option to set the price label and font-weight.
How to set color swatches option on a product:-
· To set the option on a product first thing we have to create the options. To create the options go to Admin > Catalog > Options > Edit Checkbox/Radio > Then click to add button then Select type, Enter option name, Upload the image and then finally select the color then click to save button.
Apply the option on the product:-
· To add the option on product go to Catalog > Product > Add/Edit any product then go to option tab. Select the Option type which is checkbox then fill the all values according to your needs then finally click to add button.
· After doing all this then go to the front of your website open the product on which you have added the options.
Get This Extension At https://www.purpletreesoftware.com/option-images-color-swatches.html
Quels sont les vins blancs considérés comme "secs" ?

Published: 2019-10-25 08:59:31

Bonsoir, bonsoir ! Je suis le Dr Vinifera, mais vous pouvez m'appeler Vinny. Posez-moi vos questions les plus difficiles sur le vin, de l'étiquette à la science de la vinification. Et ne vous inquiétez pas, je ne suis pas un snob du vin - vous pouvez aussi me poser ces "questions idiotes" que vous êtes trop gêné pour poser à vos amis geeks du vin ! J'espère que vous trouverez mes réponses éducatives, stimulantes et même amusantes. Et n'oubliez pas de consulter mes questions les plus fréquentes et mes archives complètes pour toutes mes questions et réponses classiques.

Cher Dr Vinny,

Quand une recette demande un [vin blanc sec](https://illivino.com/c/vins-blancs-secs/), de quels vins s'agit-il ? Je sais qu'un vin de dessert n'est pas considéré comme sec. Que sont les blancs "secs" ?

-Jack H., Indianapolis

Cher Jack,

Qu'un vin soit considéré "sec" ou non dépend de la quantité de sucre résiduel qu'il contient. Techniquement, les vins de moins de 10 grammes par litre sont considérés comme "secs", ceux de plus de 30 grammes par litre sont des vins "doux" ou de dessert, et tout ce qui se situe entre les deux est considéré comme "non sec". Dans la pratique, différentes personnes ont des seuils différents pour goûter le goût sucré du vin, donc ce que vous considérez sec peut avoir un goût sucré pour une autre personne.

En général, certains vins blancs sont presque toujours élaborés dans un style sec : Sauvignon Blanc, Pinot Grigio, Albariños espagnols et Grüner Veltliners autrichiens, par exemple. Certains vins se situent souvent entre le sec et le déshydraté : de nombreux Chardonnays, Rieslings, Viogniers et Pinot Gris du Nouveau Monde, par exemple. Et certains blancs sont toujours doux : Le Sauternes et les embouteillages "vendanges tardives" de raisins tels que le Riesling et le Chenin Blanc en sont des exemples.

Quoi qu'il en soit, dégustez toujours un vin avant de cuisiner avec lui. Si ce n'est pas amusant à boire, cela n'améliorera pas votre plat.

-Docteur Vinny