teleren/devto huggingface dataset:
Zombie Cheat Sheet
Tags: zombie, cheatsheet
Published: 2021-05-13 08:59:31


### [Zombie] Expectations

```js
expect(browser.query("#brains"))

expect(browser.body.queryAll(".hand")).length 2

console.log(browser.html())
console.log(browser.html("table.parts"))

expect(Browser.text(".card-nopad small"), "A better way to get around!")
```

### [Zombie] Examples

```js
browser
  .visit("http://.../", ->)
  .fill("email", "zombie@underworld.dead")
  .fill("password", "eat-the-living")
  .select("Born", "1985")
  .uncheck("Send newsletter")
  .clickLink("Link name")
  .pressButton("Sign", () => { ... })
  .text("H1")
```

### Reference

* [Zombie Cheat Sheet](https://cheatsheetmaker.com/zombie) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
New plugin management product survey
Published: 2021-05-12 18:28:26

Hello guys! I suppose you already know how complicating and time-consuming the management of private plugins can be, right?

The problem is while the public plugins are all gathered in the WP marketplace, the private plugins have no centralized location from where you can find them and install them. This is resulting in the inability to easily update your private plugins, wasting a lot of time and money, and is generally a frustrating process.

This is why we are developing a marketplace for private plugins! It is called the Private Enterprise Marketplace and it is meant to be a marketplace and a management tool for plugins across all your WordPress projects.

We have entered a startup program from the Silicon- Valey based accelerator Founder Insitute and as part of the program, we are required to gather some potential user feedback about our product, if you can please [fill this form](https://serenichron.com/private-enterprise-market-plugin-survey/) for just 1 min of your time, we will reward you afterward!

Until now we have created the management tool part and we are already saving A LOT of time for ourselves and A LOT of money for our clients.

Currently, we are using this solution for our clients’ projects and we think we can scale it up and offer it to more people.

Our management solution is harnessing the power of composer so if you are managing plugins and themes via composer, please leave me a message and I’ll be happy to tell you how you can automate things too.

If you are not using composer, again, please leave me a message and I’ll be happy to tell you how using composer with our solution can significantly reduce your time or money spent.
Vagrant Cheat Sheet
Tags: vagrant, cheatsheet
Published: 2021-05-13 08:58:42


### Also see

* [Vagrant website](http://vagrantup.com) _(vagrantup.com)_
* [Vagrantfile cheatsheet](./vagrantfile)
* [Vagrant Cheat Sheet](https://cheatsheetmaker.com/vagrant) - [Cheat Sheet Maker](https://cheatsheetmaker.com)

### Get started

Add some base boxes:
{: .-setup}

```bash
vagrant box add precise64 http://files.vagrantup.com/precise64.box
```

Work it:

```bash
mkdir test_box
cd test_box
vagrant init precise64
```

Run it:

```bash
vagrant up
vagrant ssh
```

To stop, use one of the following:

```bash
vagrant ssh        # then: sudo shutdown -h now
vagrant suspend
vagrant destroy    # !!
```
Pacman Cheat Sheet
Tags: pacman, cheatsheet
Published: 2021-05-13 08:53:17


### [Commands] References

* [Pacman tips and tricks](https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks) _(wiki.archlinux.org)_
### [Commands] Other

| Command            | Description                |
| ------------------ | -------------------------- |
| `pactree <pkg>`    | What does _pkg_ depend on? |
| `pactree -r <pkg>` | What depends on _pkg_?     |

### [Commands] Orphans

| Command                       | Description                 |
| ----------------------------- | --------------------------- |
| `pacman -Qdt`                 | List unneeded packages      |
| `pacman -Rns $(pacman -Qdtq)` | Uninstall unneeded packages |

Avoid orphans by using `pacman -Rsc` to remove packages, which will remove unneeded dependencies.

### [Commands] Query

| Command              | Description                            |
| -------------------- | -------------------------------------- |
| `pacman -Qe`         | List explictly-installed packages      |
| ---                  | ---                                    |
| `pacman -Ql <pkg>`   | What files does this package have?     |
| `pacman -Qii <pkg>`  | List information on package            |
| ---                  | ---                                    |
| `pacman -Qo <file>`  | Who owns this file?                    |
| ---                  | ---                                    |
| `pacman -Qs <query>` | Search installed packages for keywords |

### [Commands] Common commands

| Command                 | Description                       |
| ----------------------- | --------------------------------- |
| `pacman -Syu <pkg>`     | Install (and update package list) |
| `pacman -S <pkg>`       | Install only                      |
| `pacman -Rsc <pkg>`     | Uninstall                         |
| `pacman -Ss <keywords>` | Search                            |
| `pacman -Syu`           | Upgrade everything                |

### Reference
* [Pacman Cheat Sheet](https://cheatsheetmaker.com/pacman) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
Zsh Cheat Sheet
Tags: zsh, cheatsheet
Published: 2021-05-13 08:46:58


### Also see

- [Bash cheatsheet](https://cheatsheetmaker.com/bash)

Zsh is mostly compatible with Bash, so most everything in Bash's cheatsheet also applies.
### Process Substitution

| Expression        | Example                                               | Description
| ---               | ---                                                   | ---
| `<(COMMAND)`      | `grep "needle" <(curl "https://haystack.io")`         | Replace argument with _named pipe/FIFO_ (read-only) with command output
| `=(COMMAND)`      | `vim =(curl "https://haystack.io")`                   | Replace argument with _file_ (writable) containing command output
{: .-headers}

### Change default shell

```bash
chsh -s `which zsh`
```

### Expressions

| Expression        | Example             | Description
| ---               | ---                 | ---
| `!!`              | `sudo !!`           | Last command (`sudo !!`)
| ---               | ---                 | ---
| `!*`              | `vim !*`            | Last command's parameters (`vim !*`)
| `!^`              |                     | Last command's first parameter
| `!$`              |                     | Last command's last parameter
| ---               | ---                 | ---
| `!?ls` `<tab>`    | `sudo !?mv` `<tab>` | Command and params of last `ls` command
| `!?ls?:*` `<tab>` |                     | Params of last `ls` command
| ---               | ---                 | ---
| `*(m0)`           | `rm *(m0)`          | Last modified today
| `*(m-4)`          |                     | Last modified <4 days ago

### Reference
* [Zsh Cheat Sheet](https://cheatsheetmaker.com/zsh) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
Divshot Cheat Sheet
Tags: divshot, cheatsheet
Published: 2021-05-13 08:43:16


### Custom domains

See [custom domains guide](http://docs.divshot.com/guides/domains).

```sh
divshot domains:add foo.bar.com
```

In your DNS create a `CNAME`: (no apex domains are supported)

```
www.    CNAME    yourname.divshot.io
```

### [CLI] Password protect

```sh
divshot protect <env> <username:password>
```

### [CLI] App management

```
divshot create <appname>
divshot rename <newname>
divshot status
divshot destroy
divshot apps
divshot account
```

### [CLI] Environment vars

```
divshot env:add <env> KEY=value
divshot env:remove <env> KEY
divshot env:pull <env>
```

### [CLI] Config
Edits `divshot.json`

```

divshot config:add name your-app-name
divshot config:remove name
```

### CLI

```sh
divshot s   # server

divshot push [staging|production|development]
divshot pull [staging|production|development]
divshot purge   # cleans cache
divshot files

divshot promote development production

divshot open [<env>]
```

### Configuration

See [configuration reference](https://docs.divshot.com/guides/configuration) and [routing guide](https://docs.divshot.com/guides/routing).

```json
{
  "name": "yourapp",
  "root": "./app",
  "clean_urls": true,
  "clean_urls": ["/app/**", "/!components/**"],,
  "error_page": "error.html",
  "exclude": [ "Gruntfile.js" ],
  "cache_control": {},
  "routes": {
    "/*.html": "index.html",
    "/app/**/*.html": "app.html",
    "**": "index.html"
  },
  "redirects": {
    "/old/:segment/path": "/new/path/:segment",
    "/some/old/path": {
      "status": 302,
      "url": "/some/new/path"
    }
  },
  "headers": {
    "/cors-stuff/**": {
      "Access-Control-Allow-Origin": "*"
    },
    "/scripts/**": {
      "content-type": "text/javascript"
    }
  }
}
```

### [Getting started] Push your app

```
$ divshot push
```

### [Getting started] Create divshot.json

```json
{
  "name": "yourapp",
  "root": "./app"
}
```

### [Getting started] Install divshot-cli

```
$ npm install -g divshot-cli
$ divshot login
```

### Reference

* [Divshot Cheat Sheet](https://cheatsheetmaker.com/divshot) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
Vim-Unite Cheat Sheet
Tags: vimunite, cheatsheet
Published: 2021-05-13 08:36:31


### Options

| Option                     | Description                                                 |
| -------------------------- | ----------------------------------------------------------- |
| `-start-insert`            |                                                             |
| `-no-quit`                 |                                                             |
| `-winheight=10`            |                                                             |
| `-quick-match`             | select by pressing asdf keys                                |
| `-winwidth=40`             | use with vertical                                           |
| `-no-split`                | open in current buffer                                      |
| `-auto-preview`            | great for outline                                           |
| `-vertical`                | open as sidebar                                             |
| `-buffer-name=xxx -resume` | resume the next time it's called (faster)                   |
| `-input=`                  | reset input (use with -resume)                              |
| `-unique`                  | remove duplicates (eg, if using `file_rec` with `file_mru`) |
### Sources

* `file/new`
* `file/async`
* `file_rec/async`
* `file_rec/git`
* `buffer`
* `buffer_tab` (current tab only)
* `tab`
* `register`
* `bookmark`
* `source`

### Usage

``` vim
:Unite file
:Unite file_rec/async:!
:Unite tag
:Unite buffer
```

### Reference
* [Vim-Unite Cheat Sheet](https://cheatsheetmaker.com/vim-unite) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
Day 60 of 100 Days Of SwiftUI
Tags: swift, 100daysofcode
Published: 2021-05-13 08:35:41

I just completed day 60 of 100 Days of SwiftUI. Today I worked on an app challenge. 
Here's a link to the [source code](https://github.com/sanmiAde/Friendz)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zd5wkeacdxnoeph5vaj8.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwx7p7ytf9hj51id0hl5.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/juy9zqczd6cv9d72lvd3.png)
Flashlight Cheat Sheet
Tags: flashlight, cheatsheet
Published: 2021-05-13 08:35:40


### [Commands] References

* [Flashlight](http://flashlight.nateparrott.com/)
* [Flashlight on GitHub](https://github.com/nate-parrott/Flashlight)
* [Creating a plugin](https://github.com/nate-parrott/Flashlight/wiki/Creating-a-Plugin)

### [Commands] Web search

* `/react`

Prefix with `/` to do a web search.

### [Commands] Emoji

* `emoji grin`
* `:rocket:`

### [Commands] System

* `shutdown`
* `restart`
* `logout`
* `sleep`
* `ejall`
* `screen saver`

### [Commands] DuckDuckGo

* `!g foo`
* `!mdn settimeout`

### [Commands] Events and reminders

* `add Dinner with Rico 5 pm tomorrow`
* `remind Go to school at 2:30pm`
* `remind Go to school in 15 mins`

### Commands

### Reference
* [Flashlight Cheat Sheet](https://cheatsheetmaker.com/flashlight) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
Lists in Python
Tags: tutorial, todayilearned, python, programming
Published: 2021-05-13 08:19:23

Hello Everyone!!
Today I will be sharing what I learned about lists in Python.

#### What are lists?
List are one of the **most used**, **most powerful**, **most easy** and also **most efficient** data structure built in to Python.

> Some languages also call it arrays.

### Basic structure of a list
```python
# make a list of names
names = ['john', 'jack', 'mary', 'jane']
```
> and it's done, you can mix any datatype in a list but it is not recommended.

### Adding Items to the list
To add items to an existing list use the `append()` method

```python
# taking our initial list
names = ['john', 'jack', 'mary', 'jane']
print(names)

# == output ==
# ['john', 'jack', 'mary', 'jane']

# now let's add something
names.append('jonas')
# printing the changed list with name that we add
print(names)

# == output ==
# ['john', 'jack', 'mary', 'jane', 'jonas']
```

### Removing Items from the list
There are different options used to remove items in a list:
some common ones are:

#### `pop()` - removes the last value in the list

```python
# taking our initial list
names = ['john', 'jack', 'mary', 'jane', 'jonas']

# let's say we don't want the last value again.
names.pop()

# let's print our list again
print(names)

# == output ==
['john', 'jack', 'mary', 'jane']
```

#### `remove(value)` - removes the `value` passed in the list

```python
# taking our initial list
names = ['john', 'jack', 'mary', 'jane', 'jonas']

# this time we want to remove 'mary'
names.remove('mary')

# let's print our list again
print(names)

# == output ==
['john', 'jack', 'jane', 'jonas']
```
> `remove(value)` only removes the first value it finds, not all of it.

#### `del` - deletes a value based on the index

```python
# taking our initial list
names = ['john', 'jack', 'mary', 'jane', 'jonas']

# this time we only want to remove the second item
# lets assume we don't know the value.
del names[1]

# let's print our list again
print(names)

# == output ==
['john', 'mary', 'jane', 'jonas']
```

There are many more functions to use in the list:
  some others are:
* `sort()` - sorts the list
* `copy()` - returns a copy of the current list
* `extend(another_list)` - extends a list to the current one.*(almost like `append()`)*
[This article](https://www.freecodecamp.org/news/python-list-append-vs-python-list-extend/#:~:text=append()%20adds%20a%20single,the%20end%20of%20the%20list.&text=append()%20takes%20a%20single,dictionaries%2C%20sets%2C%20strings). explains in detail
* `clear()` - clears everything in the list.

#### Here are some other references
* [W3Schools](https://www.w3schools.com/python/python_lists.asp)
* [Official Python Docs](https://docs.python.org/3/tutorial/datastructures.html)
* [Real Python](https://realpython.com/python-lists-tuples/)
* [Google For Education](https://developers.google.com/edu/python/lists)
* [Programiz](https://www.programiz.com/python-programming/list)

Thanks for reading, leave a comment or a suggestion to more links or code snippets.
Change your Windows background by running a python script!
Tags: python, discuss, fun
Published: 2021-05-13 08:21:09

Let's write some fun codes with Python :) Before we get started, be sure to note that this post is only for Windows users! An interesting idea for those who work with Windows.

What do you do if you want to change your desktop background using python? You are probably going to a library or looking for a library, but this does not require a library in Windows, and you can change the background without installing a special library and using ctypes.
In fact, the desktop background can be changed using a commonly used command to change system parameters in ctypes. (let's write the program object-oriented so that our work is clean and orderly.)

```python
import ctypes

class Main:
    def __init__(self):
        path = 'c:/...'
        ctypes.windll.user32.SystemParametersInfoW(20, 0, path , 0)

application = Main()
```
It is easy to change your desktop wallpaper temporarily by giving the address of the png, jpg, etc. file.
Now let's make the program a little more attractive, suppose we have a folder called "backgrounds" and we want to randomly select an image from it and set it on our desktop background.
First we need to get the address of where the project is now located. We can do this using os and sys

```python
>>> import os
>>> import sys
>>> os.path.abspath(os.path.dirname(sys.argv[0]))
'C:\\Users\\user'
```

Now just take the "backgrounds" folder and download the files in it and put them in a list. Of course, note that we receive files that end with png, jpg and jpeg, Then select a random item and order it to change the desktop background randomly. (To select a random option from a list we need a random library)

```python

import os
import sys
import ctypes
import random

class Main:
    def __init__(self):
        self.path = os.path.abspath(os.path.dirname(sys.argv[0]))
        for root, directories, files in os.walk(os.path.join(self.path, 'backgrounds')):
            self.backgrounds = [file.lower() for file in files if file.endswith(('.png', '.jpg', '.jpeg'))]

        ctypes.windll.user32.SystemParametersInfoW(20, 0, os.path.join(self.path, 'backgrounds', random.choice(self.backgrounds)) , 0)

application = Main()
```

We are done! Now we can put the images we want in the "backgrounds" folder and temporarily set a random background on our desktop every time we run this script.

## An interesting point!
If you want to run this script automatically when you turn on your computer, you can open the 'run' window with the key combination (win + r) and enter the 'shell: startup'. After entering, a folder will open for you. Just copy the script to this folder. (Every program in this folder runs when you turn on your computer)
Bundler Cheat Sheet
Tags: bundler, cheatsheet
Published: 2021-05-13 08:15:47


### Rake Gem tasks

    # Rakefile
    require 'bundler/gem_tasks'

Terminal:

    $ rake release
    $ rake build
### Local gem development

In your Gemfile, define a Git source and a branch:
    gem 'hello', github: 'rstacruz/hello', branch: 'master'
And then:
    $ bundle config --global local.xxx ~/projects/xxx

### Deployment
    $ bundle install --without=test,development --deployment
### Grouping
    group :development do
      gem 'hello'
    end
### Github support
    gem 'hello', github: 'rstacruz/hello'
    gem 'hello', github: 'rstacruz/hello', 'branch: master'
### Gems
    gem 'hello'
    gem 'hello', group: 'development'
### Commands
    bundle                  # same as bundle install
    bundle install          # installs gems
    bundle install -j3      # faster (3 jobs)
    bundle update           # update all gems
    bundle update --source gemname  # update specified gem

    bundle outdated         # show outdated gems
    cd `bundle show rails`  # inspect a gem's dir

    bundle gem              # new gem skeleton
### Reference
* [Bundler Cheat Sheet](https://cheatsheetmaker.com/bundler) - [Cheat Sheet Maker](https://cheatsheetmaker.com)
Homebrew Cheat Sheet
Tags: homebrew, cheatsheet
Published: 2021-05-13 08:14:37


### Also see
*   [Homebrew homepage](https://brew.sh/) _brew.sh_
*   [Homebrew docs](https://docs.brew.sh) _docs.brew.sh_ {: .-also-see}
### Brew Cask commands

| Command                       | Description                           |
| ---                           | ---                                   |
| `brew install --cask firefox` | Install the Firefox browser           |
| `brew list --cask`            | List installed applications           |

Cask commands are used for interacting with graphical applications.

### Global commands

| Command         | Description              |
| ---             | ---                      |
| `brew update`   | Update brew and cask     |
| `brew upgrade`  | Upgrade all packages     |
| `brew list`     | List installed           |
| `brew outdated` | What's due for upgrades? |
| `brew doctor`   | Diagnose brew issues     |

### More package commands

| Command                    | Description                 |
| ---                        | ---                         |
| `brew info git`            | List versions, caveats, etc |
| `brew cleanup git`         | Remove old versions         |
| `brew edit git`            | Edit this formula           |
| `brew cat git`             | Print this formula          |
| `brew home git`            | Open homepage               |
| `brew search git`          | Search for formulas         |

### Commands

| Command                    | Description                 |
| ---                        | ---                         |
| `brew install git`         | Install a package           |
| `brew uninstall git`       | Remove/Uninstall a package  |
| `brew upgrade git`         | Upgrade a package           |
| ---                        | ---                         |
| `brew unlink git`          | Unlink                      |
| `brew link git`            | Link                        |
| `brew switch git 2.5.0`    | Change versions             |
| ---                        | ---                         |
| `brew list --versions git` | See what versions you have  |


### Reference

* [Homebrew Cheat Sheet](https://cheatsheetmaker.com/homebrew) - [Cheat Sheet Maker](https://cheatsheetmaker.com)