text:
---
layout: single
title: "Updating my blog theme with git"
excerpt: "My blog is a static site hosted with Github Pages. I initially forked a theme that I liked and now I need to fetch the latest updates..."
permalink:
tags:
  - github
  - git
  - jekyll
categories:
published: true
header:
  teaserlogo:
  teaser: ''
  image: images/headers/mountain01_1920x500.jpg
  caption: 'unsplash.com'
gallery:
  - image_path: ''
    url: ''
    title: ''
toc: true
toc_label: "Table of content"
---

In this short post, I'll show how I update my static website hosted on github using git.

I moved my blog from Google Blogger to Github Pages and Jekyll about 2 years ago.

1. I found a Jekyll theme that I liked,
1. forked the repository,
1. rename the repository to `<github username>.github.io`
1. Blog up and running! 🚀
1. You can now clone your fork locally and start writting blog posts.

The migration of my old blog posts and comment was another story 😶.

## Starting a blog from an existing theme

We can summarize the workflow described above like this:

1. Fork a repository (blog theme source)
1. Clone your fork locally
1. Create custom content locally and commit back to your fork
1. Static website gets regenerated each time you commit to your fork

![image-center](/images/2019/2019-06-29-blogtheme_update_with_git/step1.png){: .align-center}

## Blog theme update

However, when the Blog theme author release a new version, **how to you pull the latest changes ?**

![image-center](/images/2019/2019-06-29-blogtheme_update_with_git/step2.png){: .align-center}

One of the great advantage of having my blog content hosted on git is that I can easily use git to pull the last updates from the jekyll theme used.

In my case I'm using the [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes) Jekyll theme from [mmistakes](https://github.com/mmistakes). You'll need to adapt the following code for the theme that you are using.

1. **List your remote repositories**: You must first ensure there's an upstream remote. If you forked the theme's repo then you're likely good to go.
   * To double check, run `git remote -v` and verify that you can fetch from origin `https://github.com/mmistakes/minimal-mistakes.git`
1. **Add your remote repositories (optional)**: To add it manually you can do the following: `git remote add upstream https://github.com/mmistakes/minimal-mistakes.git`
1. **Pull the changes**: `git pull upstream master`
   * Depending on the amount of customizations you've made after forking, there's likely to be merge conflicts. Work through any conflicting files Git flags, staging the changes you wish to keep, and then commit them. You can also do these steps using Microsoft Visual Studio Code (see below).
1. **Push the change to your fork**: `git push`

## Conflicts

When pulling the changes from the Upstream (as see above) you might see some conflicts, example during my last upgrade:

[![image-center](/images/2019/2019-06-29-blogtheme_update_with_git/git_conflicts.png){: .align-center}](/images/2019/2019-06-29-blogtheme_update_with_git/git_conflicts.png)

You resolved these issues using Visual Studio, here is an example:

![image-center](/images/2019/2019-06-29-blogtheme_update_with_git/git_conflicts-vscode.png){: .align-center}

gha_language: CSS


text:
# Lyophyllum trigonosporum (Bres.) Kühner, 1938 SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Bull. mens. Soc. linn. Lyon 7: 211 (1938)

#### Original name
Collybia trigonospora (Bres.) Mussat, 1900

### Remarks
null

repository: mdoering/backbone

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mdoering/backbone


text:
---
title: "Scala Functional Collections"
date: 2021-05-08
header:
    image: "/images/blog cover.jpg"
tags: [scala, collections]
excerpt: "A short article with a powerful idea about functional collections many Scala programmers do not know about."
---

This article is more beginner-friendly, so all you need is a basic understanding of Scala syntax, (partial) functions and collections. In what follows, I'll share some ideas about functional collections that many Scala developers are unaware of.

These ideas are actually what sparked my interest in Scala and functional programming in the first place — when one of my friends talked about this cool language he discovered (Scala) some 10 years ago and how often his mind was blown, I couldn't resist diving into it myself.

This is a compact version of a thought experiment we follow — and then write code for — in the [advanced Scala course](https://rockthejvm.com/p/advanced-scala), once we lay some foundations of FP.

No libraries are required for this article, as we will write plain Scala. Both Scala 2 and Scala 3 will work just as fine.

## 1. Exploring Functional Sets

Think of sets for a moment — those well-known collections of objects that don't allow for duplicates. The implementation of sets — be it tree-sets, hash-sets, bit-sets, etc — is less important than what they _mean_.

Let's build a small set:

```scala
val aSet = Set(1,2,3,4,5)
```

The critical API of a set consists of

- the ability to tell whether an item is in the set or not
- the ability to add an element to a set (and if it exists, don't add it again)
- the ability to remove an element from the set (and if it doesn't exist, don't remove it again, of course)

Let's concentrate on the first capability at the moment. The way we tell whether an element is in the set is by calling `contains`, or `apply`:

```scala
aSet.contains(2) // true
aSet(2) // also true
```

Notice that the apply method makes the set "callable" like a function. At the same time, that invocation always returns a value (true or false), for any argument you pass to it.

So notice that a set behaves like a function `A => Boolean`, because you can pass any argument of type A, and you'll get a Boolean (whether or not the argument is in the set).

Here's an outrageous idea: **sets ARE functions**!

If you dive deeper into the Set definition from the standard library, you'll eventually find a declaration that fits:

```scala
trait Set[A] extends Iterable[A]
    with collection.Set[A]
    with SetOps[A, Set, Set[A]]
    with IterableFactoryDefaults[A, Set] {
  ...
}

// in the scala.collection.immutable package

trait SetOps[A, +CC[X], +C <: SetOps[A, CC, C]]
  extends collection.SetOps[A, CC, C] {
  ...
}

// in the general scala.collection package

trait SetOps[A, +CC[_], +C <: SetOps[A, CC, C]]
  extends IterableOps[A, CC, C]
    with (A => Boolean) { // <-- jackpot!
  ...
}
```

## 2. Writing a Small Functional Set

Here's a small experiment — let's write a small implementation of a set that implements the functional interface `A => Boolean`:

```scala
trait RSet[A] extends (A => Boolean) {
    def apply(x: A): Boolean = contains(x)
    def contains(x: A): Boolean
    def +(x: A): RSet[A]
    def -(x: A): RSet[A]
}
```

The main trait implements the crucial Set API:

- testing if an element is in the set
- adding an element
- removing an element

Let's then continue with an implementation of an empty set, correctly typed. The standard library uses an object typed with `Set[Any]` and then type-checked via casting, but let's use a small case class for our experiment:

```scala
case class REmpty[A]() extends RSet[A] {
    override def contains(x: A) = false
    def +(x: A): RSet[A] = ???
    def -(x: A): RSet[A] = this
}
```

The implementation of 2 out of 3 methods is easy:

- the set doesn't contain anything, so `contains(x) == false` for all x in A
- the set can't remove anything, so return the same set

We'll come back to the third method shortly.

Let's now consider a set given by a property, i.e. similarly to how we were taught in math classes. For example, the set of all even natural numbers is something like `{ x in N | x % 2 == 0 }`. Pure sets in mathematics are described by their properties. Some sets may be finite, or infinite, some may be countable (or not).

We're not going to dive super-deep into the rabbit hole — that's a job for my students in the advanced Scala course — but let's try declaring a small set in terms of the property of their elements (a property-based set):

```scala
case class PBSet[A](property: A => Boolean) extends RSet[A] {
    def contains(x: A): Boolean = property(x)
    def +(x: A): RSet[A] = new PBSet[A](e => property(e) || e == x)
    def -(x: A): RSet[A] = if (contains(x)) new PBSet[A](e => property(e) && e != x) else this
}
```

Let's look at the main API methods:

- this set is all about the property of the elements, so `contains` returns true only if that property is satisfied
- adding an element means adjusting the property so that it also holds true for the element we want to add
- removing an element means adjusting the property so that it definitely returns false for the element we're removing

And that's it! The set will not contain duplicates nor change if we try removing a non-existent element, because neither makes any sense now.

Coming back to REmpty's add method, it will look like this:

```scala
def +(x: A): RSet[A] = new PBSet[A](_ == x)
```

A single-element set is a property-based set, where the property only returns true for that particular element.

Of course, we can test this out. Let's make a small helper method that will allow us to build sets more easily:

```scala
object RSet {
  def apply[A](values: A*) = values.foldLeft[RSet[A]](new REmpty())(_ + _)
}
```

Then in main, we can run some tests:

```scala
val first5Elements: RSet[Int] = REmpty[Int]() + 1 + 2 + 3 + 4 + 5
val first5lementsFancy = RSet(1,2,3,4,5)
val first1000Elements = RSet(1 to 1000: _*) // pass as varargs

first5Elements(42) // false
first5lementsFancy(3) // true
first1000Elements(68) // true
```

Is this cool or what?

The interesting thing about this set definition is that you can now declare _infinite_ sets, just based on their property. For example, the set of even natural numbers is now trivial:

```scala
val allEvens = PBSet[Int](_ % 2 == 0)
```

You can then add other operations on sets, e.g. intersection, union, difference, concatenation (even with infinite sets). Go wild!

## 3. Other Functional Collections

The idea above blew my mind when I first discovered it, roughly 10 years ago. I was always under the impression that a collection must hold _elements_, but here we have a completely different approach to it. Of course, nobody is naive, memory is not free: we're storing increasingly complex (and memory-occupying) properties instead of elements. But the mental model is the best value for this idea.

With the functional approach for sets clarified, we can easily extend this to other collections.

For example, think of the main API of a sequence (Seq) in Scala: sequences have the sole job of giving you an item at an index. If that index is out of bounds, an exception will be thrown.

```scala
val aSeq = Seq(1,2,3)
aSeq(1) // 2
aSeq(5) // Out of bounds!
```

Question: what functional "thing" is invokable like a function, but _not on all arguments_?
Hint: it starts with "P" and rhymes with "artialFunction".

Yep, I said it: sequences are partial functions. The type of the argument is an Int (the index which you want to access) and the return type is A (the type of the Seq). It's also found in the standard library:

```scala
// scala.collection.immutable
trait Seq[+A] extends Iterable[A]
                 with collection.Seq[A]
                 with SeqOps[A, Seq, Seq[A]]
                 with IterableFactoryDefaults[A, Seq] {
  ...
}

// scala.collection
trait Seq[+A]
  extends Iterable[A]
    with PartialFunction[Int, A] // <-- jackpot
    with SeqOps[A, Seq, Seq[A]]
    with IterableFactoryDefaults[A, Seq]
    with Equals {
  ...
}
```

As a mental exercise: try implementing a Seq as a `PartialFunction[Int, A]`!

Same idea is applicable to Maps. Maps are "invokable" objects on a key, returning a value (if it exists) or throwing an exception (if it doesn't). What's that again? PartialFunction!

```scala
// scala.collection.immutable
object Map extends MapFactory[Map] { ... }
//      ^                      ^
//      | immutable Map        | general Map

// scala.collection
trait Map[K, +V]
  extends Iterable[(K, V)]
    with collection.Map[K, V]
    with MapOps[K, V, Map, Map[K, V]]
    with MapFactoryDefaults[K, V, Map, Iterable] {
  ...
}

// still there
trait MapOps[K, +V, +CC[_, _] <: IterableOps[_, AnyConstr, _], +C]
  extends IterableOps[(K, V), Iterable, C]
    with PartialFunction[K, V] // <-- here
{
  ...
}
```

## 4. Conclusion

We've just learned that many critical Scala collections are not just "functional", but they are _actual_ functions. If your mind was at least moved a bit (not necessarily blown away), I'm really happy. These kinds of concepts make functional programming great, and Scala awesome.

license: MIT


text:
# WorkoutTracker17
App allows for the user to track workouts. User has the capability to add either cardio or resistance training to a mongo database. The user input is stored by day. Each exercises stats are display in a dashboard to show the previous 7 days of workouts.

# Code
-HTML

-CSS

-JQuery

-Javascript

-mongoDB

-Express

# ScreenShots

# License

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

gha_language: JavaScript


text:
# MGR.CommandLineParser documentation

`MGR.CommandLineParser` is a multi-command line parser library.
It provides an extensible mechanism to provide define commands
(with multiple out-of-the-box providers)
and is able to automatically generate help/usage output for all commands.
Built-in providers lets you define command by:

- [creating a class](class-based/create-class-based-command.md) that implements `MGR.CommandLineParser.Command.ICommand` or inherits `MGR.CommandLineParser.Command.CommandBase` (provides some basic behavior for commands like support of `--help` option)
- [dynamically defining a command that uses a lambda](lambda/create-a-lambda-based-command.md) as execution (via the package `MGR.CommandLineParser.Command.Lambda)

The general syntax on the command line is:
`<commandName> <options> <arguments>`

Options can be specified by their _normal/long_ form (`--full-option`)
or with its short form (`-fo`).
The value of the option can be separated of the name of the option
by a space (` `) or a colon (`:`).

Arguments is a list of non-option string that is passed to the command.

There is also some ways to customize others parts of the parser:

- how to display information to the user: the [`IConsole` interface](extensibility/console.md)
- how the value of the options are converted: the [`IConverter` interface](extensibility/converter.md)

This library use [dependency injection](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection) to retrieve the implementation of all this service, so you just have to register your own implementation to override/augment the default behavior.

---
## [Customize command display](customize-command-display.md)
## [Call command's options](call-command-options.md)
## [Customize the internal of the parser](customize-internal-of-parser.md)

repository: mgrosperrin/commandlineparser

branch_name: refs/heads/dev

gha_language: C#

gha_license_id: MIT

repo_name: mgrosperrin/commandlineparser


text:
College project (TBP) - FOI 2020

Project for Database theory course at Faculty of Organization and Informatics

## Table of Contents

- [About the Project](#about-the-project)

- [Built With](#built-with)

- [Getting Started](#getting-started)

- [Prerequisites](#prerequisites)

- [Installation](#installation)

- [Usage](#usage)

- [Roadmap](#roadmap)

- [Contributing](#contributing)

- [License](#license)

- [Contact](#contact)

## About The Project

Practicing MERN stack. TMDb API used for this project. --> https://www.themoviedb.org/

### Built With

- [MongoDB]()

- [ExpressJS]()

- [ReactJS]()

- [NodeJS]()

## Getting Started

To get a local copy up and running follow these simple steps.

### Prerequisites

This is an example of how to list things you need to use the software and how to install them.

- npm

```sh

npm install npm@latest -g

```

### Installation

1. Clone the moviesMERN

```sh

git clone https://github.com/kmaodus/moviesMERN.git

```

2. Install server NPM packages (inside root folder)

```sh

npm install

```

3. Install NPM packages in client directory

```sh
cd client

npm install

```

4. Cd back to root directory and run

```sh
cd ..
npm start

```

## Usage

You can register if you want to add movies in your favorites list, otherwise you can view latest popular movies and view detailed movie info by clicking on an image. If you are logged in you can also leave comments and likes on a movie.

![Sign up](./assets/register.png)
![Sign in](./assets/login.png)
![Landing Page when the user is signed in](./assets/landingPage.jpg)
![Landing Page scroll](./assets/landing2.jpg)
![Movie info](./assets/movieInfo.jpg)
![Actors view](./assets/actors.png)
![List of favorites](./assets/favorites.png)

## Roadmap

See the [open issues](https://github.com/kmaodus/moviesMERN/issues) for a list of proposed features (and known issues).

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project

2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)

3.  Push to the Branch (`git push origin feature/AmazingFeature`)

5. Open a Pull Request

## License

Distributed under the MIT License.

## Contact

Project Link: [https://github.com/kmaodus/moviesMERN](https://github.com/kmaodus/moviesMERN)

[contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=flat-square
[contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=flat-square
[forks-url]: https://github.com/othneildrew/Best-README-Template/network/members
[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=flat-square
[stars-url]: https://github.com/othneildrew/Best-README-Template/stargazers
[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=flat-square
[issues-url]: https://github.com/othneildrew/Best-README-Template/issues
[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=flat-square
[license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/othneildrew
[product-screenshot]: images/screenshot.png

repository: sandeepanumalla/yosank

branch_name: refs/heads/main

repo_name: sandeepanumalla/yosank


text:
---
layout: post
title: "v0.1 of (*majallat*) *al-Muqtabas*"
subtitle: "Volume 6"
author: Till Grallert
date: 2017-02-01
gh-repo: tillgrallert/digital-muqtabas
gh-badge: [star, fork, follow]
avatar: /assets/images/title_muqtabas.png
categories: releases
tags:
- xml
- page breaks
- linked facsimiles
- journal_al-muqtabas
---

We just released v0.1, the first proper release, of the journal *al-Muqtabas*. As per our release schedule this release includes the following:

- TEI files of all twelve issues of the **sixth** volume of *al-Muqtabas* with tructural mark-up of mastheads, sections, articles, and with page breaks linked to the facsimiles;
- MODS and BibTeX files for all issues, sections, and articles;
- Copies of TEI schema files from [OpenAraPE_ODD](https://github.com/OpenArabicPE/OpenArabicPE_ODD);
- A local installation of the TEI Boilerplate for Arabic editions;
- all XSLT stylesheets necessary for various transformations from sources (shamela) and to other formats (md), for generating bibliographic metadata (MODS, BibTeX), for improving mark-up, linking page breaks to facsimiles, etc.

Thanks to the efforts of CERN's [Zenodo](https://zenodo.org) platform we even got a DOI! [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.266730.svg)](https://doi.org/10.5281/zenodo.266730)


text:
# Contributing Guidelines

Please follow common guidelines for our projects [here](https://github.com/packit/contributing).

## Reporting Bugs

- [List of known issues](https://github.com/packit-service/dashboard/issues) and
  in case you need to create a new issue, you can do so [here](https://github.com/packit-service/dashboard/issues/new).

## Guidelines for Developers

### Naming Scheme

- `camelCase` for variable names.
- Indentation: 4 Spaces.
- Regular JS functions are defined like `function someFunction()`
- React components are defined using the arrow syntax.
- [React Hooks](https://reactjs.org/docs/hooks-intro.html) style syntax is used, wherever possible, over [the old Class based](https://reactjs.org/docs/hooks-intro.html#classes-confuse-both-people-and-machines) syntax.

### Running packit-service/dashboard locally on Docker

1. Build docker image

```
make build-stg
```

2. Generate private key

```
openssl genrsa -des3 -out secrets/privkey.pem 1024
```

3. Generate Certificate Signing Request

```
openssl req -new -key secrets/privkey.pem -out secrets/signing-request.csr
```

4. Remove Passphrase from Key

```
openssl rsa -in secrets/privkey.pem -out secrets/privkey.pem
```

5. Generate self signed certificate

```
openssl x509 -req -days 365 -in secrets/signing-request.csr -signkey secrets/privkey.pem -out secrets/fullchain.pem
```

6. Start dashboard container

```
make run-container-stg
```

7. Install CA (optional)

```
cp secrets/fullchain.pem /usr/local/share/ca-certificates/dashboard-fullchain.crt
sudo update-ca-certificates
```

### Increase System Limit for File Watchers

While transpiling and packing code, webpack continuously watches all dependencies for changes. It's not uncommon to encounter a system limit on the number of files you can monitor.

Increase it with

```
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
```

[Technical details](https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers#the-technical-details)

---

Thank you for your interest!

repository: lachmanfrantisek/dashboard

repo_name: lachmanfrantisek/dashboard


text:
---
# Display name
title: Marcus Alexander

# Is this the primary user of the site?
superuser: true

# Role/position/tagline
#role: research scientist

# Organizations/Affiliations to show in About widget
organizations:
- name: Human Nature Lab
  url: https://www.humannaturelab.net/
- name: Yale Institute for Network Science
  url: https://yins.yale.edu/
- name: Yale University
  url: https://www.yale.edu/

# Short bio (displayed in user profile at end of posts)
bio: My research interests network science, public health, and computational genomics.

# Interests to show in About widget
interests:
- Network Science
- Computational Genomics
- Public Health

# Education to show in About widget
education:
  courses:
  - course: BA, Yale University
  #  institution: Stanford University
  #  year: 2012
  - course: MPhil, University of Oxford
  #  institution: Massachusetts Institute of Technology
  #  year: 2009
  - course: PhD, Harvard University
#    institution: Massachusetts Institute of Technology
 #   year: 2008
  - course: Postdoc research, Stanford University School of Medicine
  - course: MD Class of 2024, Frank H. Netter MD School of Medicine

# Social/Academic Networking
# For available icons, see: https://sourcethemes.com/academic/docs/page-builder/#icons
#   For an email link, use "fas" icon pack, "envelope" icon, and a link in the
#   form<EMAIL_ADDRESS>or "/#contact" for contact widget.
social:
- icon: envelope
  icon_pack: fas
  link: '/#contact'
- icon: twitter
  icon_pack: fab
  link: https://twitter.com/mqdicer
- icon: graduation-cap  # Alternatively, use `google-scholar` icon from `ai` icon pack
  icon_pack: fas
  link: https://scholar.google.com/citations?user=WrRcc7wAAAAJ&hl=en&oi=ao
#- icon: github
#  icon_pack: fab
#  link: https://github.com/gcushen
#- icon: linkedin
#  icon_pack: fab
#  link: https://www.linkedin.com/

# Link to a PDF of your resume/CV.
# To use: copy your resume to `static/media/resume.pdf`, enable `ai` icons in `params.toml`,
# and uncomment the lines below.
# - icon: cv
#   icon_pack: ai
#   link: media/resume.pdf

# Enter email to display Gravatar (if Gravatar enabled in Config)
email<EMAIL_ADDRESS>
# Highlight the author in author lists? (true/false)
highlight_name: false

#this goes to bottom
#{{< icon name="download" pack="fas" >}} Download my {{< staticref "media/demo_resume.pdf" "newtab" >}}resumé{{< /staticref >}}.
---

I work as a research scientist in the [Human Nature Lab](https://humannaturelab.net), directed by [Nicholas A. Christakis](https://nicholaschristakis.net) at the [Yale Institute for Network Science](https://yins.yale.edu). We study biology of human sociality using network science, population genetics, behavioral experiments, and field randomized controlled trials.

I am also studying to become a physician at the [Frank H. Netter MD School of Medicine](https://www.qu.edu/schools/medicine/), where I co-founded the [Genomics and Personalized Medicine Interest Group](https://netgene.ghost.io).


text:
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*

*List which issues are fixed by this PR.*

*Please add a note to `packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md` if your change requires release notes. Otherwise, add the 'release-notes-not-required' label to the PR.*

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [ ] I read the [Flutter Style Guide] _recently_, and have followed its advice.
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or there is a reason for not adding tests.

![build.yaml badge]

If you need help, consider asking for help on [Discord].

<!-- Links -->
[Contributor Guide]: https://github.com/flutter/devtools/blob/master/CONTRIBUTING.md
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[CLA]: https://cla.developers.google.com/
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[build.yaml badge]: https://github.com/flutter/devtools/actions/workflows/build.yaml/badge.svg

repository: flutter/devtools

gha_language: Dart

repo_name: flutter/devtools


text:
---
contentType: blog
path: /programming/think-like-a-programmer
title: Think Like A Programmer
date: '2018-07-12T00:36:28-04:00'
attachments:
  - filename: /files/programmer.jpg
related:
  - post: /js/hello-javascript
---
## Introduction

When someone talks about programming or coding, it's easy to imagine it's all this:

It looks frightening and overwhelming. But I'm here to say **DO NOT PANIC!**

This looks way more terrifying than it actually is.

The truth is you probably already can think like a programmer and probably don't even realize it.

![

Computers are like very good doggies (after going graduating from obedience school, of course!).

They'll listen and follow your every commands, but only exactly what you tell it to do. If you don't tell them to roll over, they won't roll over. :(

A **programming language** is a language which the computer understands. The problem is that computers don't really understand human language. If we tell the computer:

Nothing will happen. In fact, the computer will give you an error telling you that it did not understand the command. However, if we use a programming language called python to tell it to do the exact same thing:

And there you go! We have programmed.

Each programming language has its own **syntax** which is the set of rules on how the language should be structure based on what the computer expects it to be. This can include the spelling and grammar of the language (which is why good copy editors make good programmers). The good news is that many programming languages share similar syntax rules.

However, computers are inflexible because they're binary. They either work or they don't. When the computer is not doing what you want it to do, there's probably an error in how you wrote the code. That's where **testing** and **debugging** comes in that helps you **trace** the problem so you can find a solution.

## Figuring out how to go from human language to computer language

Let's write a recipe for arroz con pollo.

**Class Assignment:** We're going to write down specific instructions on how to cook arroz con pollo.

Now that we've written our recipe, let's identify the following things:

* A simple command: Do something
* We declare/define/label an item: This is a something.
* A conditional command: If something happens, then do something.

## Simple programming concepts (that you've just written!)

### Statements

They are a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task.

> **Add Olive Oil in to a cooking pan.**

### Declarations

Determines the name and data type of a variable that you are defining

> **The boiling point of the water is 212 degrees Fahrenheit**

### Logical Operators

Symbols that tells the program to perform specific mathematical, relational or logical operation and produce final result. May return a boolean data type of true or false. Examples: AND, OR, GREATER THAN, LESS THAN, EQUAL TO

> **Add more than two teaspoons of salt and more than or equal to five teaspoons of paprika to rice.**

Note: In Javascript below, AND is denoted by "&&", OR is denoted by "||", greater than is denoted by ">"

### Conditional Statements

A set of statements performed if a certain condition is met.

**When water reaches boiling point, add rice to pot**

### Functions

These are sections of code which you can call to perform certain actions. Can include parameters.

> **Chop garlic and onion into seven pieces**

### Loops

A sequence that is continually repeated until a certain condition is reached.

> **Stir in onions, garlic, salt, rice and paprika in pot**

### The Similarities Between the Languages

Just like Spanish, French and Italian have their similarities in language, so do the programming languages.

Let's take the same the loop, written in a language called Javascript, from above:

This is the same loop written in a language called Python:

This is the same loop written in a language called Ruby:

## More Hands-On Examples

Explain the following code examples into human language:

**PYTHON**

**JAVASCRIPT**

**PYTHON**

**LOLCATS**


text:
# Clavatiporopollenites K. Ambwani & R.S. Singh, 1996 GENUS

#### Status
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
The Palaeobotanist 43: -. [139-142]

#### Original name
null

### Remarks
null


text:
# cp
copy and paste text over web - very simple

# Introduction
To enhance security, working environment is seperated into two or three, i.e.,
- the Internet-only PC for web surfing,
- development PC for limited internet access, and
- production or operation PC for the internal system management.

To protect data loss, communication among these PCs are restricted. It means that
I can't use any method which provides file transfer mechanism. The only communication
acceptable is short text messages. So 'cp' is created to exchange short text!

# Requirement
A web server which support PHP script.

# Package
One PHP script file.

# Installation
Donwload the php script file. Modify working directory which is for storing short message and access log.

# Status
Currently, only register and retrieval is supported.
No logging

# Language
Mixed - English and Korean

# LOC
- 215 lines, initial version

# License
MIT

# Author
Never been a developer.
Writes codes about 200 lines in a year, average. :-)

repository: james-chi/cp

repo_name: james-chi/cp


text:
# Sonarr Backfiller
This script is intended to allow you to query your backlog of missing episodes without having to do them 10 at a time or all at once.

## Required to be installed
 - Python 2.7

Standard Library
 - requests module
 - json module
 - urlparse module
 - datetime module

3rd Part Libraries Required
 - PyYAML module
 - requests module

## Usage

Linux Directions (I am not providing directions for installing the 3rd party libraries)
```
# cd /opt # change this to your desired location
# git clone https://github.com/FracKenA/Sonarr_Backfiller.git
# cp ./Sonarr_backfiller/sonarr_backfiller.yaml.sample ./Sonarr_Backfiller/sonarr_backfiller.yaml
# chmod a+x sonarr_backfiller.py
# nano ./Sonarr_backfiller/sonarr_backfiller.yaml
# # See the below section for editing the yaml file.
# # to execute the command run the below command
# ./Sonarr_backfiller/sonarr_backfiller.py
```

Edit the yaml file replacing the api_key and address fields. You can also change the queue and active count before adding.
```
logging_level: "DEBUG"
logging_file_name: "sonarr_backfiller"
sonarr:
  sort_direction: "desc"
  number_of_results: 30
  api_key: "SONARR_API_KEY"
  address: "http://sonarr_address:port"
  queue_minimum: 50
```

You can create a cron task to execute this, however don't select too many at once. I will be adding additional checks and a check of the current queue status at a later date.

Pull Requests are always welcome.

gha_language: Python


text:
---
title: "attachMenuPeerTypeSameBotPM"
description: "The bot attachment menu entry is available in the chat with the bot that offers it"
nav_exclude: true
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Constructor: attachMenuPeerTypeSameBotPM
[Back to constructors index](/API_docs/constructors/index.html)

The bot attachment menu entry is available in the chat with the bot that offers it

### Type: [AttachMenuPeerType](/API_docs/types/AttachMenuPeerType.html)

### Example:

```
$attachMenuPeerTypeSameBotPM = ['_' => 'attachMenuPeerTypeSameBotPM'];
```

repository: danog/MadelineProtoDocs

gha_language: PHP

repo_name: danog/MadelineProtoDocs


text:
---
title: Y9 Blog - Week 4
layout: post
author: rory.collins
permalink: /y9-blog---week-4/
source-id: 1P3M1OUK-VNYC3APdjzIKHQeQgYig-ntOfxu0ekML8mY
published: true
---
Today we started considering business costs that a real business would run into if it had employees. You can find the list below in the embedded spreadsheet. The list was long with lots of rejected ideas. We started to look at the potential costs of paying employees. We started by running over whether an employee was paid hourly or monthly. We then have been trying create a table that would calculate the total costs of the payroll. We were set homework to make our blogs look as amazing as physically possible. We also had to embed our spreadsheet into our blog. Below is the finished product.

<iframe src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSjUiwfQ2nqvgvqrKODxofjbO-CnFkhVR6giBRpZVShenSHSUMTrgQ6C8LThoqRY05SVeGYEWyGiqif/pubhtml?widget=true&headers=false"></iframe>


text:
---
description: Learn how to configure time-based one time passwords for MFA.
topics:
  - mfa
  - duo
contentType:
  - how-to
useCase:
  - customize-mfa
---
# Configure One Time Passwords for MFA

To use one time passwords as an authentication factor, users need an Authenticator app such as:

* Authy ([Google Play](https://play.google.com/store/apps/details?id=com.authy.authy) / [App Store](https://itunes.apple.com/us/app/authy/id494168017)).
* Google Authenticator ([Google Play](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2) / [App Store](https://itunes.apple.com/us/app/google-authenticator/id388497605)).
* Auth0 Guardian ([Google Play](https://play.google.com/store/apps/details?id=com.auth0.guardian) / [App Store](https://itunes.apple.com/us/app/auth0-guardian/id1093447833)).
* Microsoft Authenticator ([Google Play](https://play.google.com/store/apps/details?id=com.azure.authenticator) / [App Store](https://itunes.apple.com/us/app/microsoft-authenticator/id983156458)).

![MFA OTP Signup](/media/articles/mfa/mfa-otp-setup.png)

Upon signup, they can scan a code and set up the app, upon which it will begin generating one-time codes.

Afterwards, when logging in to the app, the user can simply check the authenticator app for the current one-time code:

And enter the code at the prompt:

![MFA OTP Login](/media/articles/mfa/mfa-otp-login.png)

Your users will need to have an OTP Authenticator app installed in their mobile devices.

## Keep reading

* [Enroll and Challenge OTP Authenticators using the MFA API](/mfa/guides/mfa-api/otp)


text:
# NGINX CAS authentication module in Lua
This is a POC project of a Lua module to authenticate CAS users on NGINX before reaching the application.

## How the module works
After authenticating, the following cookies are created:

usrtoken: is a sha1 + base64 signed cookie with a secret

usrid: is a base64 signed cookie representing the CAS username

## Configuration
Edit the nginx configuration: config/default

Replace $cas_server with your CAS ticket authentication URL

Replace $secret with a secretive token

## Example
The example rails application demonstrates how to verify the signed cookie

repository: BigbigY/cas-auth-lua-nginx

repo_name: BigbigY/cas-auth-lua-nginx


text:
---
date: '2022-02-03'
title: Understanding Selenium 4
category: Selenium
tags:
  - selenium
  - java
---

# Selenium 4

## What's new?

We have been waiting for Selenium 4 release whilst using Selenium 3.x for a long time.
Now that Selenium 4 is released, let's look at key changes.
Official [Upgrade Document](https://www.selenium.dev/documentation/webdriver/getting_started/upgrade_to_selenium_4/) captures the essentials and I did not face any challenge during the change.

- W3C WebDriver standard capabilities
- Consolidation of FindElement methods
- TimeUnit to Duration in Java

There is a huge enhancement to [Selenium Grid](https://www.selenium.dev/documentation/grid/) in terms of Architecture and stability which we will cover in another blog.

We will check on BiDi API and DevTools.

## BiDi API

Selenium has introduced mechanisms for user to perform advanced browser actions. [BiDi API](https://www.selenium.dev/documentation/webdriver/bidirectional/) (BiDirectional API) let's user to control events of browser DOM. It is still in early stages and not all browsers have implemented per the [W3C spec](https://w3c.github.io/webdriver-bidi/)

### Register Basic Auth

We can handle basic auth of website easily using [HasAuthentication](https://www.selenium.dev/documentation/webdriver/bidirectional/bidi_api/#register-basic-auth)

```java
Predicate<URI> uriPredicate = uri -> uri.getHost().contains("your-domain.com");
((HasAuthentication) driver).register(uriPredicate, UsernameAndPassword.of("admin", "password"));
driver.get("https://your-domain.com/login");
```

After this, user does not have to append user name and password to the URL for basic auth resulting in password leaks.

### Mutation Observation

When there are DOM changes, we can now listen and interact on it. This is particularly helpful in validation and page load conditions.

```java
AtomicReference<DomMutationEvent> seen = new AtomicReference<>();
CountDownLatch latch = new CountDownLatch(1);
EventType<Void> domMutation = domMutation(mutation -> {
    String id = mutation.getElement().getAttribute("id");
    if ("spchl".equals(id)) {
        seen.set(mutation);
        latch.countDown();
    }
});
```

With a `DomMutationEvent`, we can fetch the element and operate on it. Though there may be multiple dom changes, we can search and filter as required.

### Network Interception

With the new [Network Interception](https://www.selenium.dev/documentation/webdriver/bidirectional/bidi_api/#network-interception) feature, we can let go of legacy Proxy approaches to inspect network traffic.
Earlier, we had to create a proxy server (BrowserMob Proxy) and route Selenium calls via proxy to capture network logs.

With `NetworkInterceptor`, we can tweak the application response and test various functional flows easily.

```java
Routable routable = Route.matching(req -> req.getUri().contains("/main/home.jsp"))
    .to(() -> req -> new HttpResponse()
        .setStatus(200)
        .addHeader("Content-Type", MediaType.HTML_UTF_8.toString())
        .setContent(utf8String("Creamy, delicious cheese!")));
```

- A step is considered duplicate if the annotation and step name is present more than once.
- If alias scanning is included, steps are considered duplicate if step name is present more than once.

## DevTools

Selenium 4 provides direct access to the Chrome DevTools Protocol (CDP), but we should avoid using it directly. It is better to use WebDriver Bidi APIs as it will be stable across releases.

### Performance Metrics

Using [DevTools](https://www.selenium.dev/documentation/webdriver/bidirectional/bidi_api/#collect-performance-metrics), we can collect performance metrics during the execution and use it for validation.

```java
WebDriver driver = new ChromeDriver();
driver = new Augmenter().augment(driver);
DevTools devTools = ((HasDevTools) driver).getDevTools();
devTools.createSession();

devTools.send(Performance.enable(Optional.empty()));
List<Metric> metricList = devTools.send(Performance.getMetrics());

driver.get("https://google.com");
driver.quit();

for (Metric m : metricList) {
    System.out.println(m.getName() + " = " + m.getValue());
}
```

If a certain metric value is beyond threshold value, the test can be failed.

### Network Conditions

We can also emulate Network conditions to better test the application.

_Note: This feature involves Chrome's Emulation feature specific to browser version_

```java
WebDriver driver = new ChromeDriver();
driver = new Augmenter().augment(driver);
DevTools devTools = ((HasDevTools) driver).getDevTools();
devTools.createSession();

devTools.send(Network.enable(Optional.of(1000000), Optional.empty(), Optional.empty()));
    devTools.send(
        emulateNetworkConditions(false, 100, 200000, 100000,
            Optional.of(ConnectionType.CELLULAR4G)));
long startTime = System.currentTimeMillis();
driver.navigate().to("https://www.google.com");

long endTime = System.currentTimeMillis();

System.out.println("Load time is " + (endTime - startTime));
```

### GeoLocation

We can tweak the user's geolocation via DevTools [GeoLocation](https://www.selenium.dev/documentation/webdriver/bidirectional/chrome_devtools/#emulate-geo-location) feature.

_Note: This feature involves Chrome's Emulation feature specific to browser version_

```java
WebDriver driver = new ChromeDriver();
driver.navigate().to("https://the-internet.herokuapp.com/");
driver = new Augmenter().augment(driver);
DevTools devTools = ((HasDevTools) driver).getDevTools();
devTools.createSession();
devTools.send(Emulation.setGeolocationOverride(Optional.of(52.5043),
    Optional.of(13.4501),
    Optional.of(1)));
driver.get("https://my-location.org/");
```

repository: EverWhimsical/site-core

repo_name: EverWhimsical/site-core


text:
# shifted-semver-increment

> Support _major version zero_ incrementing alongside existing `semver` package behavior.

`shifted-semver-increment` supports a different incrementing behavior then the [semver](https://www.npmjs.com/package/semver) package when the `major` version, the first number in `major.minor.patch`, of a [semantic version](http://semver.org/) string, is zero.

When using the standard `semver` package, a _major version zero_ is treated the same as a any other value for the major version. For example, incrementing a `minor` for `0.0.0` will increment the middle number by one, just as it would if the initial version had been `1.0.0`.

With `shifted-semver-increment`, incrementing the `major` version will increment what is traditionally the `minor` number in the semantic version string, while incrementing the `minor` or `patch` version will increment the `patch` number in the semantic version string.

When the major version is greater than zero, `shifted-semver-increment` will defer to the [`inc`](https://www.npmjs.com/package/semver#functions) function provided by the [semver](https://www.npmjs.com/package/semver) package.

## Table of Contents
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Installation](#installation)
- [Usage](#usage)
- [Debugging](#debugging)
- [Node Support Policy](#node-support-policy)
- [Contributing](#contributing)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Installation

To install the `shifted-semver-increment` tool for use in your project please run the following command:

```bash
yarn add [--dev] shifted-semver-increment
```

## Usage

```javascript
const shiftedSemver = require(`shifted-semver-increment`);

// When using a version with the major version set to zero.
shiftedSemver(`0.0.0`, `patch`); // `0.0.1`
shiftedSemver(`0.0.0`, `minor`); // `0.0.1`
shiftedSemver(`0.0.0`, `major`); // `0.1.0`

// When using a version with the major version greater than zero.
shiftedSemver(`1.0.0`, `patch`); // `1.0.1`
shiftedSemver(`1.0.0`, `minor`); // `1.1.0`
shiftedSemver(`1.0.0`, `major`); // `2.0.0`
```

By shifting the use of each number developers can continue to use semantic concepts such as releasing breaking changes in a `major` release, but remain in a pre-`1.0.0` release stage (The pre-release stage means the project does not have a stable, publicly consumable, API according to [Semantic Versioning 2.0.0](http://semver.org/)).

`shifted-semver-increment` also supports [_Prerelease Identifiers_](https://www.npmjs.com/package/semver#prerelease-identifiers) for _major version zero_ releases.

```javascript
const shiftedSemver = require(`shifted-semver-increment`);

// When using version with the major version set to zero.
shiftedSemver(`0.0.0`, `prerelease`, `beta`); // `0.0.1-beta.0`
shiftedSemver(`0.0.0`, `prepatch`, `beta`); // `0.0.1-beta.0`
shiftedSemver(`0.0.0`, `preminor`, `beta`); // `0.0.1-beta.0`
shiftedSemver(`0.0.0`, `premajor`, `beta`); // `0.1.0-beta.0`
shiftedSemver(`0.1.0-beta.0`, `prerelease`, `beta`); // `0.1.0-beta.1`
shiftedSemver(`0.1.0-beta.0`, `prepatch`, `beta`); // `0.1.1-beta.0`
shiftedSemver(`0.1.0-beta.0`, `preminor`, `beta`); // `0.1.1-beta.0`
shiftedSemver(`0.1.0-beta.0`, `premajor`, `beta`); // `0.2.0-beta.0`

// When using a version with the major version greater than zero.
shiftedSemver(`1.0.0`, `prerelease`, `beta`); // `1.0.1-beta.0`
shiftedSemver(`1.0.0`, `prepatch`, `beta`); // `1.0.1-beta.0`
shiftedSemver(`1.0.0`, `preminor`, `beta`); // `1.1.0-beta.`
shiftedSemver(`1.0.0`, `premajor`, `beta`); // `2.0.0-beta.0`
```

## Debugging

To assist users of `shifted-semver-increment` with debugging the behavior of this module we use the [debug](https://www.npmjs.com/package/debug) utility package to print information to the console. To enable debug message printing, the environment variable `DEBUG`, which is the variable used by the `debug` package, must be set to a value configured by the package containing the debug messages to be printed.

To print debug messages on a unix system set the environment variable `DEBUG` with the name of this package prior to executing a tool that invokes this module:

```bash
DEBUG=shifted-semver-increment [CONSUMING TOOL]
```

On the Windows command line you may do:

```bash
set DEBUG=shifted-semver-increment
[CONSUMING TOOL]
```

## Node Support Policy

We only support [Long-Term Support](https://github.com/nodejs/LTS) versions of Node.

We specifically limit our support to LTS versions of Node, not because this package won't work on other versions, but because we have a limited amount of time, and supporting LTS offers the greatest return on that investment.

It's possible this package will work correctly on newer versions of Node. It may even be possible to use this package on older versions of Node, though that's more unlikely as we'll make every effort to take advantage of features available in the oldest LTS version we support.

As each Node LTS version reaches its end-of-life we will remove that version from the `node` `engines` property of our package's `package.json` file. Removing a Node version is considered a breaking change and will entail the publishing of a new major version of this package. We will not accept any requests to support an end-of-life version of Node. Any merge requests or issues supporting an end-of-life version of Node will be closed.

We will accept code that allows this package to run on newer, non-LTS, versions of Node. Furthermore, we will attempt to ensure our own changes work on the latest version of Node. To help in that commitment, our continuous integration setup runs against all LTS versions of Node in addition the most recent Node release; called _current_.

JavaScript package managers should allow you to install this package with any version of Node, with, at most, a warning if your version of Node does not fall within the range specified by our `node` `engines` property. If you encounter issues installing this package, please report the issue to your package manager.

## Contributing

Please read our [contributing guide](https://gitlab.com/hyper-expanse/open-source/shifted-semver-increment/blob/master/CONTRIBUTING.md) to see how you may contribute to this project.

repository: rvnanosoft/travis

repo_name: rvnanosoft/travis


text:
---
title: Using provider-specific APIs
date: 2019-05-10T11:17:09-07:00
weight: 3
---

It is not feasible or desirable for APIs like `blob.Bucket` to encompass the
full functionality of every provider. Rather, we intend to provide a subset
of the most commonly used functionality. There will be cases where a
developer wants to access provider-specific functionality, such as unexposed
APIs or data fields, errors, or options. This can be accomplished using `As`
functions.

<!--more-->

## `As` {#as}

`As` functions in the APIs provide the user a way to escape the Go CDK
abstraction to access provider-specific types. They might be used as an
interim solution until a feature request to the Go CDK is implemented. Or,
the Go CDK may choose not to support specific features, and the use of `As`
will be permanent.

Using `As` implies that the resulting code is no longer portable; the
provider-specific code will need to be ported in order to switch providers.
Therefore, it should be avoided if possible.

Each API includes examples demonstrating how to use its various `As`
functions, and each provider implementation documents what types it supports
for each.

Usage:

1. Declare a variable of the provider-specific type you want to access.
2. Pass a pointer to it to `As`.
3. If the type is supported, `As` will return `true` and copy the
   provider-specific type into your variable. Otherwise, it will return `false`.

Provider-specific types that are intended to be mutable will be exposed
as a pointer to the underlying type.

repository: google/go-cloud

gha_language: Go

repo_name: google/go-cloud


text:
---
title: 'Sass Sundays: A Button Framework for your Projects'
author: Sugar
layout: post
category: blog
redirect_from: "/archives/web-design/a-sass-button-framework-for-your-projects"
---
I love Sass. It’s my bread & butter these days – I read, write and research Sass for most of my workday. Heck, for most of my day. It really transformed the way I work.

Sass really shines in making boring, repetitive styling more efficient and, dare I say, fun. I also happen to love styling buttons but their styling can get redundant after a while, so let’s get to that!

I posted a simple button framework in Sassmeister yesterday. Let’s take a deeper look at it.

{% highlight html %}
<button class="btn btn--primary">Primary button</button>
<button class="btn btn--primary">Secondary button</button>
{% endhighlight %}

The HTML is pretty straightforward. Just a <button> and two classes. The first class adds the basic styles, stuff like typography and padding, while the second class determines its colours. Quite basic.

I prefer using multiple classes when coding HTML because I like the luxury of using just one class (.btn in this case) to target all buttons in a module. Sure, I could use a selector like [class^="btn--"] but an extra class just works better for me.

I also use the BEM syntax for this. BEM is a convention created by the intelligent folks at Yandex which I consider one of the best ways to write modular CSS. I won’t say more, just read this excellent article by Harry Roberts on that.

Now, the magic. I use Sass & Compass in this example, but this can easily be done in vanilla Sass as well.

{% highlight scss %}
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----

@import "compass";

// Basic button styles
.btn {
  cursor: pointer;
  border: none;
  border-radius: 2px;
  display: inline-block;
  text-align: center;
  vertical-align: middle;
  padding: 8px 16px;
  box-shadow: 0 1px 2px black(0.1), inset 0 1px 0 white(0.15), inset 0 -1px 0 black(0.15);
  font: bold 14px "Helvetica Neue", Helvetica, sans-serif;
  white-space: nowrap;

  &:active,
  &.active {
    outline: none;
    position: relative;
    top: 1px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
  }
}

// Button mixin
@mixin button($background-color, $text-color) {
  @include background(linear-gradient(lighten($background-color, 3%), darken($background-color, 3%)));
  color: $text-color;

  @if lightness($text-color) < 50% {
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  } @else {
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
  }

  &:hover,
  &.hover {
    @include background(linear-gradient(lighten($background-color, 5%), darken($background-color, 1%)));
    text-decoration: none;
  }
}

// Colour variations
.btn--primary   { @include button(#ea6ca4, #fff); }
.btn--secondary { @include button(#d6d6d6, #707070); }
{% endhighlight %}

First, I add some basic styles to the .btn class. That way, even if I don’t add a second class for some reason, I still have a simple button that doesn’t look broken. This class also includes the :active state styles, since these are common for all buttons (a tiny nudge downwards and a different shadow).

Then I create a button mixin which will generate all colour-related styles for our buttons. It takes two arguments, the background color and text colour respectively. It creates a light gradient by combining a slightly darker and a slightly lighter version of the background colour, then checks to see if the background is dark or light and adds a bottom white or top black shadow to create an inset effect. It also adds hover styles by tweaking the background gradient to a lighter effect.

And that’s pretty much it! Check the section below for some tweaks you could do. Now get this into a _buttons.scss partial and get cracking!

#### Possible optimizations

As I mentioned above, I’m a fan of the multi-class approach. If you wish to just use one class for your buttons, you can convert the .btn class above to a placeholder (%btn), then you can extend it in each of your colour classes to get the same result. That’s what Elyse Holladay does in her take here.

You can also automate the text colour depending on the background and thus reduce the number of arguments of the button mixin to one. You can use the text-shadow trick I’ve used above or one of the more advanced techniques that can be found in this amazing presentation. So much win!


text:
# RUT FORMATTER

![GitHub](https://img.shields.io/github/license/mlezcano1985/rut)
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/mlezcano1985/rut?include_prereleases)
![GitHub Workflow Status](https://github.com/mlezcano1985/rut/actions/workflows/node.js.yml/badge.svg)

Format and validate rut (Chile) number between 2 and 10 digits for browser and NodeJS.

# How to install?

```
npm install --save @mlezcano1985/rut-formatter
```

# Example

On example folder, you find out Web and NodeJS examples. Install dependencies using: `npm install`.

## Web

After install dependencies, run using a web server.

## NodeJS

If you are test on NodeJS, you can run NodeJS example using this task: `npm start`.

# How to use in NodeJS?

```
const rut = require('@mlezcano1985/rut-formatter');
const value = "111111";
console.log(rut.format(value));
```

Terminal should show _11.111-1_. Valid rut.

```
const rut = require('@mlezcano1985/rut-formatter');
const value = "1";
console.log(rut.format(value));
```

Terminal should show _null_. Invalid rut.

# Support

If you are having general issues with this package, feel free to contact me on [Twitter](https://twitter.com/mlezcano1985).

If you believe you have found an issue, please report it using the [GitHub issue tracker](https://github.com/mlezcano1985/rut/issues), or better yet, fork the repository and submit a pull request.

If you're using this package, I'd love to hear your thoughts. Thanks!


text:
# text_summarizer

Note: I am working on adding some cool features such as abstraction summary, sentiment analysis and so much more!!

## Getting Started
Steps to get started on deploying this project on the local machine.

### Prerequisites
This project was developed in python 3.7, it is recommended to create virtual environment to manage dependencies required.

### Installing
Create virtual environment (note: must have virtualenv installed)

```python3 -m virtualenv venv```

Activate virtual environment

```source venv/bin/activate```

Navigate to the app directory and download the dependencies

```./setup.sh```

### Running the function
In your main.py, import summarize function by writing "from PATH.summarize import summarize" and replace 'PATH' with your path to summarize.py

The summarize function expext two parameters (the text you want to summarize and the number of sentences you want to summary to be) and return the summary as a string.

Function header of the summarize function:
```
def summarize(text, number_of_sentences):
    """
    Summarize the text to given number_of_sentences.

    :param text: string (the text being summarized)
    :param number_of_sentences: integer
    (Must be non-negative. If greater than the total number of sentence in text, returns the whole text)
    :return: string (the summary)
    """
```


text:
<!-- start header -->
To run this example locally, execute: `ploomber examples -n ml-online`.

To start a free, hosted JupyterLab: [![binder-logo](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ploomber/binder-env/main?urlpath=git-pull%3Frepo%3Dhttps%253A%252F%252Fgithub.com%252Fploomber%252Fprojects%26urlpath%3Dlab%252Ftree%252Fprojects%252Fml-online%252FREADME.ipynb%26branch%3Dmaster)

Found an issue? [Let us know.](https://github.com/ploomber/projects/issues/new?title=ml-online%20issue)

Have questions? [Ask us anything on Slack.](http://community.ploomber.io/)

For a notebook version (with outputs) of this file, [click here](https://github.com/ploomber/projects/blob/master/ml-online/README.ipynb)
<!-- end header -->

<!-- #region -->
# Machine Learning pipeline with online API

ML pipeline that deploys using flask.

Note: all commands must be executed in the `ml-online/` directory.

## Setup

```sh
pip install --editable ".[dev]"
```

## File layout

`src/ml_online`:

1. `pipeline-features.yaml`: feature engineering YAML spec
2. `pipeline.yaml`: training pipeline
3. `infer.py`: converts training pipeline to an inference pipeline
4. `service.py`: uses inference pipeline to serve predictions using Flask

## Training pipeline
<!-- #endregion -->

```sh
ploomber build
```

Output from the training pipeline saved in the `products/` folder.

## Online API

Copy the trained model inside the project's package:

```sh
cp products/model.pickle src/ml_online/model.pickle
```

Start web application:

```python
from os import environ
import subprocess

def start_flask():
    """Start Flask and wait until it's ready
    """
    proc = subprocess.Popen(['flask', 'run'],
                        env=dict(environ, FLASK_APP='ml_online.service'),
                        stdout=subprocess.PIPE,
                        stderr=subprocess.STDOUT)

    while True:
        out = proc.stdout.readline()
        print(out.decode().strip())

        if b'5000' in out:
            break

    return proc
```

```python
proc = start_flask()
```

<!-- #region -->
*Note:* `start_flask()` is the same as executing the following a terminal:

```sh
export FLASK_APP=ml_online.service
flask run
```
<!-- #endregion -->

Open a new terminal to make predictions:

```python
import requests
```

```python
def make_request(data):
    """Hit the prediction endpoint
    """
    response = requests.post('http://<IP_ADDRESS>:5000/',
                             data=data,
                             headers={'Content-Type': 'application/json'})
    return response.json()
```

```python
make_request('{"sepal length (cm)": 5.1, "sepal width (cm)": 3.5, "petal length (cm)": 1.4, "petal width (cm)": 0.2}')
```

<!-- #region -->
*Note: The previous command is equivalent to running the following on the terminal*

```sh
curl -d  '{"sepal length (cm)": 5.1, "sepal width (cm)": 3.5, "petal length (cm)": 1.4, "petal width (cm)": 0.2}' -H 'Content-Type: application/json' http://<IP_ADDRESS>:5000/
```
<!-- #endregion -->

```python
make_request('{"sepal length (cm)": 5.9, "sepal width (cm)": 3.0, "petal length (cm)": 5.1, "petal width (cm)": 1.8}')
```

<!-- #region -->
*Note: The previous command is equivalent to running the following on the terminal*

```sh
curl -d  '{"sepal length (cm)": 5.9, "sepal width (cm)": 3.0, "petal length (cm)": 5.1, "petal width (cm)": 1.8}' -H 'Content-Type: application/json' http://<IP_ADDRESS>:5000/
```
<!-- #endregion -->

Note: Ploomber exports a Python object that encapsulates the entire inference pipeline (pre-processing + feature engineering + model inference). You can deploy it with any framework.

```python
# terminate flask app
proc.kill()
```

## Testing

The example contains some basic unit tests. To run them:

```sh
pytest -p no:warnings
```

<!-- #region -->

## Packaging

This project is a Python package. You can generate a distribution archive (`tar.gz`) or a built distribution (`.whl`) for deployment:

```sh
python -m build
```

<!-- #endregion -->

The previous command creates a `.whl` and a `.tar.gz` file in the `dist/` directory; both contain all the necessary pieces to serve predictions: dependencies, pre-processing code, and model file.

repository: adityalahariya/projects

repo_name: adityalahariya/projects


text:
---
layout: article
title: "The easy guide to securing HTTP + TLS with Go"
categories: blog
excerpt: The Go programming language - a practical guide to HTTPS security and Crypto
tags: [GopherCon India, Blackbuck Computing, Fastah, Golang, Siddharth Mathur, Go programming language, Crypto, TLS, HTTPS, Excuse me your Crypto is showing]
image:
 feature: dog_edited2.jpg
 credit: Maheima Kapur
 creditlink: https://plus.google.com/+MaheimaKapur
 teaser: Gopher_GoRequest_400x300.jpg
date: 2015-04-27
modified: 2015-04-28
comments: true
share: true
---

The [Go programming language](http://golang.org) makes it easy to write and deploy servers offering HTTPS ( HTTP + Transport Layer Security) to clients. The crypto package in Go's standard library is easy to use and well documented: it's an under-explored gem. Due to it's low-on-legacy implementation of modern standards and easy configurability, there is no reason to insert an Apache or Nginx server to terminate TLS connections. A Go application server can do it all including being the front-end. All without OpenSSL!

Within the Go standard library, the http package provides the ```ListenAndServeTLS()``` API that offers secure HTTP to clients. Once a server is functionally working, how does one check HTTPS configuration and security? Here is a practical guide:

1. Pick an audit tool to test your HTTP+TLS server
3. Understand any failures
4. Fix the issues
5. (Rinse and Repeat)

## PICK an audit tool
Let's start with the right tool. In this article, we use [scanner at Qualys SSL Labs](https://www.ssllabs.com/ssltest/). It's recommended by [Adam Langley](https://www.imperialviolet.org/2014/12/08/poodleagain.html), security maven and key author of Go's "crypto" codebase.

## RUN the tool
  * Be prepared for failing grades, like the "C" below
  * Pay attention to the security warnings shown in color-coded message boxes. Work to fix them next.

## FIX the security issues
The first significant misconfiguration reported by the above scan is the possibility of a POODLE attack. While Go doesn't support the older SSLv3 at all, you can still make the server do a smarter TLS handshake by explicitly configuring it to only advertise support of vTLS 1.0 or higher. This is done by setting ```tls.Config.MinVersion```:
{% raw %}
	// Make a server negotiate only TLS v1.0+ with clients
	config := &tls.Config{MinVersion: tls.VersionTLS10}
	s := &http.Server{TLSConfig: config}
	s.ListenAndServeTLS()
{% endraw %}

Next up is the yellow-coded warning about use of a weak cipher: RC4. You may fix this error by limiting ciphers to a stronger set via ```tls.Config.CipherSuites```. Also notice the use of ```PreferServerCipherSuites``` that forces the TLS negotiation to pick a result from the (presumably) stronger list of server-specified ciphers.
{% raw %}
	// Work for iOS 6+, WP 8.x, and Android 4.4.2+
	config := &tls.Config{
		MinVersion:               tls.VersionTLS12,
		PreferServerCipherSuites: true,
		CipherSuites: []uint16{tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
			tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
			tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
			tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
			tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
			tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
			....
		},
	}
{% endraw %}

For a comprehensive understanding of the warnings flagged by the tool, check out [Mozilla's guide to TLS and cipher suites](https://wiki.mozilla.org/Security/Server_Side_TLS).

## Rejoice at your passing grade!
Once you have fixed the issues flagged by the tool, an all-green report card awaits.

A word of caution: Before changing Go's defaults, do read the [standard library documentation for TLS](http://golang.org/pkg/crypto/tls/), and [Mozilla's guide to TLS and cipher suites](https://wiki.mozilla.org/Security/Server_Side_TLS). Additional factors to consider while tuning the HTTPS server are:

 * network round-trips required to negotiate a TLS connection
 * encryption quality and CPU/battery cost trade-off
 * legal implications if applicable.

Happy security!

(_This topic was presented by the author at a lightening talk "Excuse me, your Crypto is showing!" during [GopherCon India 2015](https://sourcegraph.com/blog/live/gopherconindia/111466342132). The shooting gopher image is attributed to creator Wisi Mongkhonsrisawat via the [GoRequest project](https://github.com/parnurzeal/gorequest)_.)


text:
---
data_non_statistical: true
goal_meta_link: http://unstats.un.org/sdgs/files/metadata-compilation/Metadata-Goal-6.pdf
graph_title: Change in water-use efficiency over time
graph_type: line
has_metadata: true
indicator: 6.4.1
indicator_definition: "This indicator is defined as the output over time of a given\
  \ major sector per volume of (net) water withdrawn (showing the trend in water use\
  \ efficiency). Following ISIC 4 coding, sectors are defined as agriculture, forestry\
  \ and fishing (ISIC 4-A); manufacturing, constructions, mining and quarrying (ISIC\
  \ 4-B, 4-C and 4-F); electricity industry (ISIC 4-D); and the municipal sector (ISIC\
  \ 4-E). For the purpose of this note, the following terminology is used: \tWater\
  \ use: general non-specific term that describes any action through which water provides\
  \ a service \tWater withdrawal: water abstracted from a river, lake, reservoir or\
  \ aquifer(V) \tReturn flow: water returning to a river, lake, reservoir or aquifer\
  \ (R) \tNet water withdrawal: water withdrawn (V) minus return flow (R) Note: If\
  \ no information is available on (R), then only (V) will be used."
indicator_name: Change in water-use efficiency over time
indicator_sort_order: 06-04-01
indicator_variable: null
layout: indicator
method_of_computation: "The indicator is disaggregated by sector, in order to allow\
  \ for different metrics in different sectors. Water efficiency in irrigated agriculture\
  \ is calculated as the agricultural value added per agricultural (net) water withdrawn,\
  \ expressed in USD/m3. In formula: Awe = GVAa x (1-Cr)Va-Ra Where: \tAwe = Irrigated\
  \ agriculture water efficiency [USD/m3] \tGVAa = Gross value added by agriculture\
  \ (excluding river and marine fisheries and forestry)[USD] \tCr = Proportion of\
  \ agricultural GVA produced by rainfed agriculture [-] \tVa =  Volume of water withdrawn\
  \ by the agricultural sector (including irrigation, livestock and aquaculture) [m3]\
  \ \tRa = Volume of water returned to the hydrologic system (return flow) [m3]  The\
  \ volume of water withdrawn by the agricultural sectors (V) is collected at country\
  \ level through national records and reported in questionnaires, in units of km3/year\
  \ or million m3/year (see example in AQUASTAT http://www.fao.org/nr/water/aquastat/sets/aq-5yr-quest_eng.xls).\
  \ Agricultural value added in national currency is obtained from national statistics,\
  \ converted to USD and deflated to the baseline year 2015. The Cr coefficient can\
  \ be estimated as Cr= 37%, on the basis of the general FAO assumption on the ratio\
  \ between rainfed and irrigated yield.  Water efficiency of industries is calculated\
  \ as the industrial value added per unit of industrial (net) water withdrawn, and\
  \ expressed in USD/m3. In formula: Iwe = GVAiVi-Ri Where: \tIwe = Irrigated water\
  \ efficiency [USD/m3] \tGVAi = Gross value added by industry (excluding energy)[USD]\
  \ \tVi =  Volume of water withdrawn by the industries (excluding energy) [m3] \t\
  Ri = Volume of water returned to the hydrologic system (return flow) [m3]  Industrial\
  \ water withdrawal (V) is collected at country level through national records and\
  \ reported in questionnaires, in units of km3/year or million m3/year (see example\
  \ in AQUASTAT http://www.fao.org/nr/water/aquastat/sets/aq-5yr-quest_eng.xls). Industrial\
  \ value added is obtained from national statistics, deflated to the baseline year\
  \ 2015. Energy (power) water efficiency is calculated as the value added of power\
  \ production per unit of (net) water withdrawn for energy production, and expressed\
  \ in MWh/m3. In formula: Ewe = TEPVe-Re Where: \tEwe = Energy water efficiency [MWh/m3]\
  \ \tTEP = Total energy production [MWh] \tVe =  Volume of water withdrawn for energy\
  \ production, i.e. for the cooling of power plants (including evaporation from reservoirs\
  \ created behind dams for hydropower) [m3] \tRe = Volume of water returned to the\
  \ hydrologic system (return flow) [m3]  Volume of water withdrawn for energy production\
  \ (V) is collected at country level through national records and reported in questionnaires,\
  \ in units of km3/year or million m3/year (see example in AQUASTAT http://www.fao.org/nr/water/aquastat/sets/aq-5yr-quest_eng.xls).\
  \ Value added of electricity production is obtained from national statistics, deflated\
  \ to the baseline year 2015. Municipal water supply efficiency is the ratio between\
  \ water effectively distributed to the municipal users and the water withdrawn for\
  \ municipal use by water supply utilities (i.e. distribution efficiency, size of\
  \ network losses). In formula: Mwe = MudVm Where: \tMwe = Municipal water supply\
  \ efficiency [-] \tMud = Water distributed to municipal users [m3] \tVm = Volume\
  \ of water withdrawn by municipal utilities (i.e. the public distribution network)\
  \ [m3] Data on volumes of withdrawn and distributed are collected at country level\
  \ from the municipal supply utilities records."
national_geographical_coverage: United States
permalink: /6-4-1/
published: true
rationale_interpretation: "The rationale behind this indicator consists in providing\
  \ information on the efficiency of the economic and social usage of water resources,\
  \ i.e. output generated by the use of water in the different main sectors of the\
  \ economy, and distribution network losses. Energy production has been disaggregated\
  \ from the industrial sector due to its specific importance for the general development\
  \ of a country. \nThe distribution efficiency of water systems is explicitly considered\
  \ only for the municipal sector, but it is nonetheless implicit within the calculations\
  \ also for the other sectors, and could be made explicit if needed and where data\
  \ are available. \nThis indicator addresses specifically the target component 'substantially\
  \ increase water-use efficiency across all sectors', by measuring the output per\
  \ unit of water from productive uses of water as well as losses in municipal water\
  \ use. It does not aim at giving an exhaustive picture of the water utilization\
  \ in a country. Other indicators, specifically those for Targets 1.1, 1.2, 2.1,\
  \ 2.2, 5.4, 5.a, 6.1, 6.2, 6.3, 6.5 will complement the information provided by\
  \ this indicator. In particular, the indicator needs to be combined with the water\
  \ stress indicator 6.4.2 to provide adequate follow-up of the target formulation.\
  \ \nTogether, the four sectoral efficiencies provide a measure of overall efficiency\
  \ in a country. The indicator provides incentives to improve water use efficiency\
  \ through all sectors, highlighting those sectors where water use efficiency is\
  \ lagging behind."
reporting_status: notstarted
sdg_goal: 6
source_active_1: true
source_notes_1: null
source_title_1: null
target: By 2030, substantially increase water-use efficiency across all sectors and
  ensure sustainable withdrawals and supply of freshwater to address water scarcity
  and substantially reduce the number of people suffering from water scarcity.
target_id: '6.4'
title: Change in water-use efficiency over time
un_custodial_agency: 'FAO (Partnering Agencies: UNEP, IUCN, UNSD, OECD, Eurostat)'
un_designated_tier: '2'
variable_description: null
variable_notes: null
---

repository: GSA/sdg-data-usa

branch_name: refs/heads/develop

repo_name: GSA/sdg-data-usa


text:
# Reading Tracer
A MEAN demo for Week 3 preparation of Advance Internet Programming subject.

Server Side: Node.js + Express.js + MongoDB + Mongoose
Client Side: Angular + Bootstrap

## Install

```bash
cd lovely-prep-server
# Install server's dependence
npm install
# Install client's dependence
npm run install-client
```

## Run
```bash
cd lovely-prep-server
# Run server and client concurrently
npm run dev
```

It should run in a new browser window. If no, please visit this demo in [http://localhost:4200/](http://localhost:4200/).

## Screenshot

![](https://i.loli.net/2018/08/05/5b669fdad862a.png)

gha_language: TypeScript


text:
---
templateKey: blog-post
title: How to Delete hiberfil.sys and Recover Disk Space on Windows
path: /how-to-delete-hiberfil-sys-and-recover-disk-space-on-windows
date: 2019-08-21
featuredpost: false
featuredimage: /img/image-4.png
tags:
  - windows
category:
  - Productivity
comments: true
share: true
---
Desktop computers rarely need to hibernate, so you can probably safely remove the hiberfil.sys file and save yourself a few GB of space. To do so, just open up a new command prompt as an administrator:

1. Click on the Start button
2. Type ‘cmd’ (don’t hit enter)
3. Right click on the Command Prompt that comes up and choose Run As Administrator.

Once you have an administrator command prompt up, just run this command:

![](/img/image-4.png)

powercfg.exe /hibernate off

Now check your disk space again and you should see the hiberfil.sys file is gone.

repository: ShadyNagy/ardalis-com-gatsby

repo_name: ShadyNagy/ardalis-com-gatsby


text:
toolbox for reddit [![Build status](https://ci.appveyor.com/api/projects/status/e4uru1b498486cdo/branch/master?svg=true)](https://ci.appveyor.com/project/creesch/reddit-moderator-toolbox-redesign/branch/master)
[![DeepScan grade](https://deepscan.io/api/teams/5774/projects/7592/branches/79819/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=5774&pid=7592&bid=79819) [![Chat on IRC](https://img.shields.io/badge/irc-%23toolbox-blue.svg)](http://webchat.snoonet.org/#toolbox) [![Discord](https://img.shields.io/discord/535490452066009090.svg?color=blue&label=discord&logo=discord&logoColor=fff)](https://discord.gg/8fGCykQ)
========================

Bundled extension of the /r/toolbox moderator tools for reddit.com

Documentation: https://www.reddit.com/r/toolbox/w/docs

## Contributing

Thinking about contributing to toolbox? Awesome! [Here is some information to get you started!][contributing]

## Development

Building the extension is relatively easy through [Node.js][nodejs].

```sh
$ npm install          # Install dependencies
$ npm run build        # Build extension .zip files for Chrome and Firefox
$ npm run build-watch  # Automatically rebuild on file changes
$ npm run docs         # Build documentation of internal interfaces
```

Once you've built a .zip for your platform, you're ready to test! Remember to reload the extension between builds.

### Testing on Chrome
**Note:** It is not needed to build for chrome as it can be run directly from source.

- Go to `chrome://extensions`.
- Check the "Developer mode" checkbox if it's not already checked.
- Click the "Load unpacked extension..." button.
- Load the `extension` directory.

### Testing on Firefox (Developer or Nightly Editions)

- Go to `about:debugging`.
- Click the "Load Temporary Add-on" button.
- Load the `/build/toolbox_v<version>_firefox.zip` file.

## Third-party Application Support

All shared features settings and data are stored in subreddit wikis through versioned JSON. Third party applications can use this data to hook into toolbox features like usernotes. Documentation for third-party application developers looking to integrate with toolbox can be found [on the wiki][third-party-docs].

## Big Thanks

Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs][saucelabs]

[nodejs]: https://nodejs.org/
[contributing]: /CONTRIBUTING.md
[third-party-docs]: https://github.com/toolbox-team/reddit-moderator-toolbox/wiki/Subreddit-Wikis
[saucelabs]: https://saucelabs.com

repository: devbaj/reddit-moderator-toolbox

repo_name: devbaj/reddit-moderator-toolbox


text:
dropwizard examples
==========

The idea of this project is to teach you dropwizard with different simple applications. Each application will focus only on one topic.

This project contains some dropwizard examples:

- **dropwizard-simpleapp**: simple dropwizard application with minimum and rational classes for kickstart.
- **dropwizard-simpleapp-healthchecks**: simple dropwizard applicaiton focuses only on health check theme.
- **dropwizard-simpleapp-auth**: simple dropwizard applicaiton shows how the authenticaiton works.
- **dropwizard-simpleapp-auth-integrationtest**: dropwizard-simpleapp-auth extension with integration test.
- **dropwizard-simpleapp-view**: example REST resource which returns html page. Boostrap is used.


text:
# firepad
Flexible Amazon Fire 2015 Brochure UI

Making adjustments to the default UI is simple.

For addtional visuals, add 600x450 images to the assets/slides folder.
Add text content, update the labels and content arrays in res/values/strings.xml

![alt tag](http://www.starlo.org/blake/Demo.png)

repository: blakewford/firepad

repo_name: blakewford/firepad


text:
# SamlSpSettings

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**entityId** | **String** | The Entity ID to use for this SAML Service Provider. This should be entered as a URI. |
**acs** | **String** | The URL of the Assertion Consumer service |
**logout** | **String** | The URL of the Single Logout service |

repository: aravindputrevu/ess-cloud-sdk-java

repo_name: aravindputrevu/ess-cloud-sdk-java


text:
# ember-cli-browser-navigation-button-test-helper
[![Build Status](https://travis-ci.org/jelhan/ember-cli-browser-navigation-button-test-helpers.svg?branch=master)](https://travis-ci.org/jelhan/ember-cli-browser-navigation-button-test-helpers)

Test helper to simulate browsers back and forward buttons in acceptance tests.

## Installation
* `ember install ember-cli-browser-navigation-button-test-helper`
* Add `import registerBrowserNavigationButtons from './browser-navigation-buttons';` and a call of `registerBrowserNavigationButtons();` before `application.injectTestHelpers();` in `tests/helpers/start-app.js`.
* Add `backButton`, `forwardButton` and `setupBrowserNavigationButtons` as predef in `tests/.jshintrc` or as globals in `tests/.eslintrc`.

## Quickstart

* Call `setupBrowserNavigationButtons();` at the start of your acceptance test.
* Simulate back button clicks by `backButton();`.
* Simpute forward button clicks by `forwardButton();`.

There is an usage example [in this acceptance test](https://github.com/jelhan/ember-cli-browser-navigation-button-test-helpers/blob/master/tests/acceptance/browser-navigation-buttons-test.js).

For more information on using ember-cli, visit [http://ember-cli.com/](http://ember-cli.com/).


text:
# ContractStorage

### Description

**Source:** [contracts/ContractStorage.sol](https://github.com/perifinance/peri-finance/blob/master/contracts/ContractStorage.sol)

repository: getkritesh/Peri

repo_name: getkritesh/Peri


text:
# CMSSquad Base
WordPress plugin that provides base features to build theme which requires Bootstrap and SiteOrigin Page Builder.
- Replace SiteOrigin Page Builder's default grid to Bootstrap grid.
- Fullscreen Image slider widget.

## Installation

1. [Page Builder by SiteOrigin](https://wordpress.org/plugins/siteorigin-panels/) and
[SiteOrigin Widgets Bundle](https://wordpress.org/plugins/so-widgets-bundle/)
must be installed beforehand.
2. Clone or download this repository, put it on `wp-content/plugins` directory, and activate it on WordPress plugins page.
3. To replace SiteOrigin Page Builder's default grid with Bootstrap grid, visit `Settings > Page Builder` menu then
enable `Bootstrap Grid` option on `Bootstrap` tab.
4. You can enable Bootstrap v3.3 or v4.1 assets on this `Bootstrap` tab as well, so your theme will no longer need to include Bootstrap
scripts or styles again.
4. Activate CMSSquad widgets on `Plugins > SiteOrigin Widgets`.

## Credits

- [SiteOrigin](https://siteorigin.com/)
- [Bootstrap](https://getbootstrap.com/)
- [FontAwesome](https://fontawesome.com/)
- [dolatabadi/siteorigin-bootstrap-grid](https://github.com/dolatabadi/siteorigin-bootstrap-grid)
- [TweenMax](https://greensock.com)
- [Switchery](http://abpetkov.github.io/switchery/)
- [imagesLoaded](https://imagesloaded.desandro.com/)

repository: cmssquad/cmssquad-base

repo_name: cmssquad/cmssquad-base


text:
# semantic-analysis
Implementing Machine learning word2vec algorithm in Python . I have used gensim library and matplotlib visualization library and used a crawler for crawling data from online newspaper. Here I have  worked semantic analysis and anomaly detection.

# requirements:
install gensim, pyqt, numpy, matplotlib, sklearn, pandas codecs.

# Before use:
please extract the files and modify the train.py line number 29 change the directory to sentences = gensim.models.word2vec.PathLineSentences('(drive letter)\your folder \Workspace\\InputAll')

# usage:
python3 train.py
python3 allgui.py


text:
# Mothercare 'finalising plans' to put UK business into administration

Published at: **2019-11-03T22:05:04+00:00**

Author: **Alex Daniel**

Original: [City A.M.](https://www.cityam.com/mothercare-finalising-plans-to-put-uk-business-into-administration/)

Mothercare is said to be finalising a restructuring plan that could involve putting its British operations into administration this week, in what would be the latest blow to the UK’s struggling retail sector.
The company, which now leans heavily on its franchising business abroad, has readied administrators to take over the unit in the coming days, according to Sky News.

        Read more:
        Mothercare annual loss jumps to £87m, delayed results reveal

Such a move would plunge thousands of people’s jobs into doubt. However, it would not directly affect its publicly quoted parent company, which is deep in talks with lenders about a refinancing deal to secure its future trading.
The retailer’s UK arm only makes up a small part of its overall sales.
Sources told the broadcaster that an insolvency process could spark a renewed effort to find a buyer, and potentially another restructuring. That could even include another wave of shop closures.
However, insiders are said to have maintained that no formal decision has yet been made, and that the move is subject to ongoing talks. Those include consulting the trustees of Mothercare’s pension scheme.
Read more: Mothercare shares fall as it delays its full year results due to their ‘complexity’
If no buyer is found in any administration process, it would put 2,500 people’s jobs at doubt. The UK workforce is made up of 500 full-time employees and 2,000 part-time staff, working across 79 standalone outlets.
Mothercare was not immediately available for comment.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
# transports

A HTTP proxy that aims to support different transports.

## Motivation

I started the [facebook tunnel](https://github.com/matiasinsaurralde/facebook-tunnel) project two years ago and I thought that it could be better to follow a modular approach for supporting other services (chat systems, platforms, *gram, *book?).

This repository includes some code to explore the idea, also I'm also planning to write a [pluggable transport](https://obfuscation.github.io/) for Tor in the future.

## Available transports

### Facebook Transport

This transports uses [surf](https://github.com/headzoo/surf), a stateful web browser built in Go.

Load your credentials by using ```export``` or the ```.env``` file:

```
<EMAIL_ADDRESS>FB_PASSWORD=supersecretpass
FB_FRIEND=yourtunnelfriend
```

### Whatsapp Transport

This transport uses a [HTTP wrapper](https://github.com/matiasinsaurralde/yowsup-http-wrapper) for [yowsup](https://github.com/tgalal/yowsup) to send/receive Whatsapp messages.

It would be good to have a "pure Golang" Whatsapp library but I think the current approach is fine for experimentation.

The following environment variables are used:

```
WA_CLIENT_LOGIN=123412341
WA_CLIENT_PASSWORD=whatsappgeneratedpassword123
WA_CLIENT_CONTACT=43214321

WA_SERVER_LOGIN=123412341
WA_SERVER_PASSWORD=whatsappgeneratedpassword123
```

**Requires Python 3**

## Contributors

* [Matias Insaurralde](https://github.com/matiasinsaurralde)

* [Carlos Carvallo](https://github.com/carloscarvallo)

## License

[MIT](https://github.com/matiasinsaurralde/transports/LICENSE)

repository: benhylau/transports

repo_name: benhylau/transports


text:
# Python-like string class for Fortran users.

### How to use

1. Compile ```StringClass.f90``` with your ```.f90``` programs.

2. Run it.

### An example

```example.f90``` works same as ```example.py```

### 3. [Try it!](https://colab.research.google.com/drive/1qRKKAODjnzeDYqILM_Utdc809SxiCQcK?usp=sharing)

repository: kazulagi/StringClass

gha_language: Fortran

repo_name: kazulagi/StringClass


text:
HICA (Host Integrated Container Applications) v0.6.0
----------------------------------------------------
[hɑɪkː]

The goal of this project is to define a set of image label metadata
and launcher tooling that understands said metadata to provide for
smooth experience running containerized applications with tight
integration with the host operating system.

### Installation

```
pip install docker-hica
```

### Docs

Versioned specification of all labels can be found in [docs/labels.md](docs/labels.md)

Guidelines for Dockerfiles can be found in [docs/dockerfile-guidelines.md](docs/dockerfile-guidelines.md)

SELinux usage is documented in [docs/selinux.md](docs/selinux.md)

### Examples

Examples directory currently contains several example Dockerfiles:
 * `jq`
 * `firefox-testing`
 * `signify`
 * `opengl-testing`
 * `test-description`

Please refer to `README.md` in each particular subdirectory for more information.
The straightforward way is to simply:
```bash
$ cd examples/example
$ docker build -t example .
$ docker-hica example
```

### Advanced usage

Let's overview the basic stuff:

```bash
$ docker-hica --help
usage: docker-hica [-h] [--show-args] [--test-injectors] [--verbose] [--yes]
                   [--selinux-label SELINUX_LABEL] [--user USER]
                   hica_app_name ...

positional arguments:
  hica_app_name
  named_action

optional arguments:
  -h, --help            show this help message and exit
  --show-args           show possible arguments for the specified
                        "hica_app_name"
  --test-injectors      executes injector tests for specified "hica_app_name"
  --verbose             print additional information
  --yes                 bypass the capability review check
  --selinux-label SELINUX_LABEL
                        provide a confinement context
  --user USER           user:group to run as (1000:1000)
```

The `--show-args` flag allows for displaying configurable parameters for image injectors, so
to see what parameters can be passed to the `examples/firefox` image, execute:
```bash
$ docker-hica --show-args firefox:1.0
usage: docker-hica [-h] [--show-args] [--verbose] [--yes]
                   [--machine-id-path MACHINE_ID_PATH]
                   [--xsocket-path XSOCKET_PATH]
                   [--x-display-num X_DISPLAY_NUM]
                   hica_app_name ...
```

When `--verbose` is specified, the Docker command is also printed out during execution:
```bash
$ docker-hica --verbose firefox:1.0
The container requests the following capabilities:
 - Bind mounts current working directory (/Repos/docker-hica) into the container
 - Bind mounts machine-id into the container
 - Bind mounts XSocket into the container
Proceed? [y/Y/n]: y
Executing: docker run -i -u 1000:1000 --volume /Repos/docker-hica:/Repos/docker-hica -w /Repos/docker-hica --volume /etc/machine-id:/etc/machine-id --volume /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=:0 firefox:1.0
```

And finally the `--yes` flag allows for skipping the initial prompt for confirmation as seen on the example above.
This option is dangerous, future versions will treat 'Y' in the prompt response as 'Yes and remmber', so that
the initial capability request is reviewed at least once.

repository: shaded-enmity/docker-hica

repo_name: shaded-enmity/docker-hica


text:
# Villager Bot Contribution Guide

## Setting up the development environment
1. Install [Git](https://git-scm.com/)
2. Install [PostgreSQL](https://www.postgresql.org/)
4. Install [Python](https://python.org) 3.10+
5. Install [Poetry](https://python-poetry.org) with Pip
    - Windows: `py -m pip install poetry`
    - Linux/Mac: `python3 -m pip install poetry`
6. Git clone this repo or your fork
    - Example: `git clone https://github.com/Iapetus-11/Villager-Bot`
7. Install dependencies with Poetry using the command `poetry install`
    - This must be done from project's top folder (the folder which contains the pyproject.toml file)
8. Create a database and execute the contents of the `setup.sql`
9. Create a `secrets.json` file in the `bot/` folder based off of `bot/secrets.example.json`
    - The Discord bot token can be generated by following [these steps](https://discordpy.readthedocs.io/en/stable/discord.html)
    - The google search keys are optional (they're used for the `!!google`, `!!youtube`, and `!!image` search commands)
    - The xapi key is optional (it's used for the `!!nametoxuid` command)
    - The Fernet key can be generated using the cryptography module, see [this example](https://cryptography.io/en/latest/fernet/#)
10. Create a `secrets.json` file in the `karen/` folder based off of `karen/secrets.example.json`
    - The cluster count should be set to `1` unless you plan to run multiple clusters with Docker
    - The shard count must be a multiple of the cluster count
    - The top.gg fields do not need to be filled out
11. (Optional if using [Docker](https://docker.com/) to run multiple clusters) Create a `.env` file based off of the `.env.example` file

## Running Villager Bot
*Villager Bot is split into two components, Karen and the clusters. A "cluster" is a group of shards (websockets connected to Discord in this case). These clusters need to share state and communicate, which is what Karen facilitates. **To run Villager Bot you must run both Karen and at least one cluster.***
#### Windows
1. Run Karen with `poetry run py -m karen` in one terminal/command prompt/powershell instance/window
2. Run a cluster with `poetry run py -m bot` in another instance/window
#### Linux/Mac
1. Run Karen with `poetry run python3 -m karen` in one terminal window
2. Run a cluster with `poetry run python3 -m bot` in another terminal window
#### PyCharm
1. Create run configurations for both Karen and a cluster
    - Both need to be ran as modules (using the `-m` flag like `-m bot` or `-m karen`) otherwise issues will occur
2. Click the run/debug buttons
#### Docker
1. Build the docker images with `docker compose build`
2. Run Villager Bot with `docker compose up`

## Contributing
- Before contributing please discuss your proposed changes in the [Discord server](https://discord.gg/39DwwUV)
- Please open a [PR (pull request)](https://github.com/Iapetus-11/Villager-Bot/pulls) to have your changes reviewed and merged
- You should run the `format` script (`poetry run format`) provided to format your code prior to submitting your PR or the PR checks will fail

## Technical discussion/questions/help
- Please join the [Discord server](https://discord.gg/39DwwUV) and use the `#💻tech-talk` channel


text:
# PyO3 and rust-cpython

PyO3 began as fork of [rust-cpython](https://github.com/dgrunwald/rust-cpython) when rust-cpython wasn't maintained. Over time PyO3 has become fundamentally different from rust-cpython.

## Macros

While rust-cpython has a `macro_rules!` based dsl for declaring modules and classes, PyO3 uses proc macros. PyO3 also doesn't change your struct and functions so you can still use them as normal Rust functions.

**rust-cpython**

```rust,ignore
py_class!(class MyClass |py| {
    data number: i32;
    def __new__(_cls, arg: i32) -> PyResult<MyClass> {
        MyClass::create_instance(py, arg)
    }
    def half(&self) -> PyResult<i32> {
        Ok(self.number(py) / 2)
    }
});
```

**pyo3**

```rust
use pyo3::prelude::*;

#[pyclass]
struct MyClass {
   num: u32,
}

#[pymethods]
impl MyClass {
    #[new]
    fn new(num: u32) -> Self {
        MyClass { num }
    }

    fn half(&self) -> PyResult<u32> {
        Ok(self.num / 2)
    }
}
```

## Ownership and lifetimes

While in rust-cpython you always own python objects, PyO3 allows efficient *borrowed objects*
and most APIs are available with references.

Here is an example of the PyList API:

**rust-cpython**

```rust,ignore
impl PyList {

   fn new(py: Python) -> PyList {...}

   fn get_item(&self, py: Python, index: isize) -> PyObject {...}
}
```

**pyo3**

```rust,ignore
impl PyList {

   fn new(py: Python) -> &PyList {...}

   fn get_item(&self, index: isize) -> &PyAny {...}
}
```

In PyO3, all object references are bounded by the GIL lifetime.
So the owned Python object is not required, and it is safe to have functions like `fn py<'p>(&'p self) -> Python<'p> {}`.

## Error handling

rust-cpython requires a `Python` parameter for constructing a `PyErr`, so error handling ergonomics is pretty bad. It is not possible to use `?` with Rust errors.

PyO3 on other hand does not require `Python` for constructing a `PyErr`, it is only required if you want to raise an exception in Python with the `PyErr::restore()` method. Due to various `std::convert::From<E> for PyErr` implementations for Rust standard error types `E`, propagating `?` is supported automatically.

gha_license_id: NOASSERTION