text:
# Huawei Mobile Services starter project for React Native
Welcome to Huawei's challenge at [Junction 2021](https://www.junction2021.com/challenges/huawei)!

You have a bunch of fresh ideas and you aspire to make them possible with the help of the [Huawei Mobile Services](https://developer.huawei.com/consumer/en/hms) (HMS). We feel your enthusiasm - that's why we prepared this React Native starter project that will allow you to start coding *immediately* and avoid time consuming configuration steps. The project is designed for Android devices only.

### I'm in!

1. fork/clone this project
2. visit the workshop Discord channel [Junction 21 Hackathon Huawei](https://discord.gg/8ZSdWKmzDS)
3. look for the file with secrets ([direct link ](https://discord.com/channels/907280815640150066/910820845860053022))
4. unzip the file into the project's *android* directory
5. start coding!

### What just happened? Am I really ready to go?

Yes!! The starter project is a React Native skeleton app that:

- has the main HMS Kits added as dependencies
- has all relevant permissions added to the Android manifest
- connects to a shared account on [App Gallery](https://consumer.huawei.com/en/mobileservices/appgallery/) which needed by the majority of the HMS Kits
- when started, you can tap on "Check HMS status" to do a check if everything is properly configured

The file with secrets is the link between the starter project and the shared account. It contains:

- the `agconnect-services.json` configuration file
- the signing configuration needed to authenticate this app to use HMS services

### Start coding
1. Add  SDK location in local.properties if needed
- Go to your Project -> Android
- Open the file local.properties
- Paste your Android SDK path depending on the operating system:
+ Windows

sdk.dir = C:/Users/USERNAME/AppData/Local/Android/sdk

+ Linux or MacOS

sdk.dir = /home/USERNAME/Android/sdk

Replace USERNAME with your user name

2. It is highly recommmended to use yarn to install package instead of npm:
    ```
    yarn
    ```
3. then run the app

    ```
    npx react-native run-android
    ```

### But I don't have a Huawei HMS test device ...

There are solutions.

1. If you're participating on-site, ask for a test device at the Huawei booth
2. Download and temporary install HMS Core on your own Android device from [here](https://appgallery.cloud.huawei.com/appdl/C10132067)
3. [Cloud Debugging](https://developer.huawei.com/consumer/en/doc/development/Tools-Guides/CloudDebugging-introduction) : this requires you to actually own/create a Huawei Developer account, but once that's done, you can just download the [HMS Toolkit Android Studio plugin](https://developer.huawei.com/consumer/en/doc/development/Tools-Guides/installation-0000001050145206) and access physical devices in the cloud

### Starter projects for other platforms

- for Native Android: https://github.com/Huawei-Nordic/Junction2021_native

- for Flutter: https://github.com/Huawei-Nordic/junction2021_flutterx

- for Unity: https://github.com/DimitriUK/Junction-21-Huawei-Example

More HMS code samples:

- https://github.com/HMS-Core
- https://github.com/Explore-In-HMS/HmsSandbox

Add more Huawei React Native plugins:
- https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/rn-intro-0000001050975015

**Happy hacking!**


text:
# Algorave : Code of Conduct
A concise code of conduct for live Algorave events, or similar events.

The English version of the full code can be found in **conduct_en.md**.

This document should be owned by the Algorave community and edited/enhanced as required. Please send any edits and additions as pull requests, they'll be warmly received.

repository: Algorave/algoraveconduct

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: Algorave/algoraveconduct


text:
# Golf Networking Blog
cpsc-314-web-development-final-project-briansteuber created by GitHub Classroom
# Description
This project emulates a blog. I intend to use this blog to communicate via golfers. If a person wants to play at a club that they are not a member at, they can create an account on my blog site and reach out to someone from that club. This blog was created using the MERN Stack.
# Table of Contents
1. Create Account Page
2. Login Page
3. Blog Page
# Installation
To install, simply clone this repository or download the zip file.
One must install mongoDB, bcyrpt, and slug to run this web app.
One must need two collections, one named 'articles' and the other 'users'.
This is all stored in my 'golfnetworkingblog' database.
After this open the app in Visual Studio Code.
Next, open up a terminal in VSC and cd into "GolfNetworkingBlog"
Afterwards, do npm run theStart.
Then, go to a browser and type in: localhost:3001
# Usage
You should start at the Create page and it will ultimatley link you to the blog page. When an account is created, you will be prompted to go to the login page and login to the account you just created. From there you will login and be at the blog page. In the blog page, you can customize settings like the about me info, and social media account names. Since this is a blog, users will be able to post, edit, delete, and reply to blogs. My blog incorperates all of these.
# Contributing
If one would like to contribute to this page, I would love the help! My email can be found at the bottom of the website as a point of contact.
# Credits
Author: Brian Steuber
Contributors: None
# License
MIT License

Copyright (c) [2020] [Brian William Steuber]

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.

license: MIT

branch_name: refs/heads/main


text:
# go-crawler

 - Golang
 - CLI
 - concurrency
 - Docker
 - Makefile
 - unit testing

## REQUIREMENTS

Write a simple web crawler in Go. The crawler should be limited to one domain - so when you start with https://docs.docker.com/, it would crawl all pages within docs.docker.com, but not follow external links, for example to the Facebook and Twitter accounts. Given a URL, it should print a simple site map, showing the links between pages.

## IMPLEMENTATION

The implementation provides a CLI tool written in Go. The command accepts two flags:
  - url      in the form of http(s)://domain(/). Default is https://docs.docker.com
  - depth    indicating how deep the crawler should go. Maximum of 10 levels are accepted, default is 3

The crawler concurrently processes links, stopping when the given depth is exceeded. Number of retrieved links on a page is currenly hardcoded to 30. The crawler then prints
out the sitemap and shows how long the crawling took (excluding the display).

b)
go build -o creepycrawly .
./creepycrawly
./creepycrawly  -url=.... -depth=...

c)
make dev
docker run --rm --name=creepycrawly quay.io/tamarakaufler/creepycrawly:v1alpha1  -url=https://docs.docker.com -depth=4

d)
make dev
CRAWLER_URL=https://docs.docker.com CRAWLER_DEPTH=2 make run

## CAVEATS

- Hardcoded number of retrieved links on a page : 30

## IMPROVEMENTS

- Provide a flag for setting the retrieved number of links on a page
- Provide a help flag showing basic command info and its usage
- Improve the sitemap display
- Limit the number of concurrently run goroutines

repository: tamarakaufler/go-crawler

repo_name: tamarakaufler/go-crawler


text:
---
title: "IBC Token Transfer"
order: 8
description: Fungible token transfers across chains
tags:
  - concepts
  - ibc
  - dev-ops
---

# IBC Token Transfer

<HighlightBox type="learning">

Transferring tokens between chains is both a common requirement and a significant technical challenge when two chains are incompatible. A convenient solution for moving tokens between chains is essential.

In this section, you will explore how a fungible token transfer can be done with IBC.

</HighlightBox>

Having looked at IBC's transport, authentication, and ordering layer (IBC/TAO), you can now take a look at [ICS-20](https://github.com/cosmos/ibc/blob/master/spec/app/ics-020-fungible-token-transfer/README.md). ICS-20 describes **fungible token transfers**.

<HighlightBox type="info">

Fungibility refers to an instance in which a token is interchangeable with other instances of that token or not. Fungible tokens can be exchanged and replaced.

</HighlightBox>

There are many use cases involving token transfers on blockchains, like the tokenization of assets holding value or initial coin offerings (ICOs) to finance blockchain projects. IBC makes it possible to transfer tokens and other digital assets between (sovereign) chains, both fungible and non-fungible tokens. For example, fungible token transfers allow you to build applications relying on cross-chain payments and token exchanges. Therefore, IBC frees up great potential for cross-chain Decentralized Finance (DeFi) applications by offering a technically reliable cross-chain interoperability protocol that is compatible with digital assets on multiple networks.

The corresponding [implementation](https://github.com/cosmos/ibc-go/tree/main/modules/apps/transfer) is a module on the application level.

![Overview of a token transfer](/academy/3-ibc/images/transferoverview.png)

Look at the picture above. You can see two chains, A and B. You also see there is a channel connecting both chains.

How can tokens be transferred between chains and channels?

To understand the application logic for a token transfer, first, you have to determine the **source** chain:

![Source chain](/academy/3-ibc/images/sourcechain.png)

Then the application logic can be summarized:

![Application logic](/academy/3-ibc/images/applicationlogic.png)

Shortly you will see the corresponding code. Now again have a look at a transfer from **source** to **sink**:

![Source to sink](/academy/3-ibc/images/sourcetosink.png)

Above the **source** is chain A. The source channel is **channel-2** and the destination channel is **channel-40**. The token denominations are represented as `{Port}/{Channel}/{denom}` (or rather their [IBC denom representation](../../tutorials/6-ibc-dev/index.md) on chain). The prefixed port and channel pair indicate which channel the funds were previously sent through. You see **transfer/channel-...** because the transfer module will bind to a port, which is named transfer. If chain A sends 100 ATOM tokens, chain B will receive 100 ATOM tokens and append the destination prefix **port/channel-id**. So chain B will mint those 100 ATOM tokens as **ibc/<hash of transfer/channel-40/uatom>**. The **channel-id** will be increased sequentially per channel on a given connection.

<HighlightBox type="note">

We can send assets (or their IBC voucher representation) in multiple _hops_ across multiple chains. Every single time the path will be prepended with the _port/channel-id/..._ prefix.

When sending this IBC denom (having had multiple hops) back to its source chain, for every hop back one _port/channel-id/..._ prefix will be taken off. This results in a return to the original denom if all the hops are reversed.

</HighlightBox>

If the tokens are sent back from the **same channel** as they were received:

![Sink to source](/academy/3-ibc/images/sinktosource.png)

Chain A will "un-escrow" 100 **ATOM tokens**, thus, the prefix will be removed. Chain B will burn **transfer/channel-40/atoms**.

<HighlightBox type="note">

The prefix determines the **source** chain. If the module sends the token from another channel, chain B is the source chain and chain A mints new tokens with a prefix instead of un-escrowing ATOM tokens. You can have different channels between two chains, but you cannot transfer the same token across different channels back and forth. If `{denom}` contains `/`, then it must also follow the ICS-20 form, which indicates that this token has a multi-hop record. This requires that the character `/` is prohibited in non-IBC token denomination names.

</HighlightBox>

![Source sink logic](/academy/3-ibc/images/sourcesinklogic.png)

You already know that an application needs to implement the [IBC Module Interface](https://github.com/cosmos/ibc-go/blob/v5.1.0/modules/core/05-port/types/module.go), so have a look at the [implementation for the token transfer](https://github.com/cosmos/ibc-go/blob/v5.1.0/modules/apps/transfer/ibc_module.go), e.g. for `OnChanOpenInit`:

```go
// OnChanOpenInit implements the IBCModule interface
func (im IBCModule) OnChanOpenInit(
    ctx sdk.Context,
    order channeltypes.Order,
    connectionHops []string,
    portID string,
    channelID string,
    chanCap *capabilitytypes.Capability,
    counterparty channeltypes.Counterparty,
    version string,
) error {
    if err := ValidateTransferChannelParams(ctx, im.keeper, order, portID, channelID); err != nil {
        return err
    }

    if version != types.Version {
        return sdkerrors.Wrapf(types.ErrInvalidVersion, "got %s, expected %s", version, types.Version)
    }

    // Claim channel capability passed back by IBC module
    if err := im.keeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)); err != nil {
        return err
    }

    return nil
}
```

`OnChanOpenAck`, `OnChanOpenConfirm`, `OnChanCloseInit`, and `OnChanCloseConfirm` will do (almost) no checks.

## Transfer packet flow

You have seen an introduction to the application packet flow in [the section on channels](./3-channels.md#application-packet-flow). This section will analyze this packet flow for the specific case of the _transfer_ module.

### Sending a transfer packet

After a channel is established, the module can start sending and receiving packets.

So where does the module send a token? Take a look at the [msg_server.go](https://github.com/cosmos/ibc-go/blob/v5.1.0/modules/apps/transfer/keeper/msg_server.go) of the token transfer module:

```go
// Transfer defines an rpc handler method for MsgTransfer.
func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) {
    ...

    if err := k.SendTransfer(
        ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp,
        ); err != nil {
        return nil, err
    }
    ...
}
```

There you see `SendTransfer`, which implements the application logic after [checking if the sender is a source or sink chain](https://github.com/cosmos/ibc-go/blob/v5.1.0/modules/apps/transfer/types/coin.go):

```go
func (k Keeper) SendTransfer(
    ctx sdk.Context,
    sourcePort,
    sourceChannel string,
    token sdk.Coin,
    sender sdk.AccAddress,
    receiver string,
    timeoutHeight clienttypes.Height,
    timeoutTimestamp uint64,
) {
  ...

    // deconstruct the token denomination into the denomination trace info
    // to determine if the sender is the source chain
    if strings.HasPrefix(token.Denom, "ibc/") {
        fullDenomPath, err = k.DenomPathFromHash(ctx, token.Denom)
        if err != nil {
            return err
        }
    }

    ...

    // NOTE: SendTransfer simply sends the denomination as it exists on its own
    // chain inside the packet data. The receiving chain will perform denom
    // prefixing as necessary.

    if types.SenderChainIsSource(sourcePort, sourceChannel, fullDenomPath) {
        ...

        // create the escrow address for the tokens
        escrowAddress := types.GetEscrowAddress(sourcePort, sourceChannel)

        // escrow source tokens. It fails if balance insufficient.
        if err := k.bankKeeper.SendCoins(...) {
        } else {
            ...

            if err := k.bankKeeper.SendCoinsFromAccountToModule(...);

            ...

            if err := k.bankKeeper.BurnCoins(...);

            ...
        }

        packetData := types.NewFungibleTokenPacketData(
            fullDenomPath, token.Amount.String(), sender.String(), receiver,
        )
        ...
    }
}
```

Take a look at the [type definition of a token packet](https://github.com/cosmos/ibc-go/blob/v5.1.0/proto/ibc/applications/transfer/v2/packet.proto) before diving further into the code:

```protobuf
syntax = "proto3";

package ibc.applications.transfer.v2;

option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types";

// FungibleTokenPacketData defines a struct for the packet payload
// See FungibleTokenPacketData spec:
// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures
message FungibleTokenPacketData {
    // the token denomination to be transferred
    string denom = 1;
    // the token amount to be transferred
    string amount = 2;
    // the sender address
    string sender = 3;
    // the recipient address on the destination chain
    string receiver = 4;
    // optional memo
    string memo = 5;
}
```

<HighlightBox type="note">

An optional _memo_ field was recently added to the packet definition. More details on the motivation, use cases, and consequences can be found in the [accompanying blog post](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b).

</HighlightBox>

### Receiving a transfer packet

A relayer will then pick up the `SendPacket` event and submit a `MsgRecvPacket` on the destination chain.

This will trigger an `OnRecvPacket` callback that will decode a packet and apply the transfer token application logic:

```go
// OnRecvPacket implements the IBCModule interface. A successful acknowledgement
// is returned if the packet data is successfully decoded and the receive application
// logic returns without error.
func (im IBCModule) OnRecvPacket(
    ctx sdk.Context,
    packet channeltypes.Packet,
    relayer sdk.AccAddress,
) ibcexported.Acknowledgement {
    ack := channeltypes.NewResultAcknowledgement([]byte{byte(1)})

    var data types.FungibleTokenPacketData
    var ackErr error
    if err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &data); err != nil {
        ackErr = sdkerrors.Wrapf(sdkerrors.ErrInvalidType, "cannot unmarshal ICS-20 transfer packet data")
        ack = channeltypes.NewErrorAcknowledgement(ackErr)
    }

    // only attempt the application logic if the packet data
    // was successfully decoded
    if ack.Success() {
        err := im.keeper.OnRecvPacket(ctx, packet, data)
        if err != nil {
            ack = channeltypes.NewErrorAcknowledgement(err)
            ackErr = err
        }
    }

    eventAttributes := []sdk.Attribute{
        sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName),
        sdk.NewAttribute(sdk.AttributeKeySender, data.Sender),
        sdk.NewAttribute(types.AttributeKeyReceiver, data.Receiver),
        sdk.NewAttribute(types.AttributeKeyDenom, data.Denom),
        sdk.NewAttribute(types.AttributeKeyAmount, data.Amount),
        sdk.NewAttribute(types.AttributeKeyMemo, data.Memo),
        sdk.NewAttribute(types.AttributeKeyAckSuccess, fmt.Sprintf("%t", ack.Success())),
    }

    if ackErr != nil {
        eventAttributes = append(eventAttributes, sdk.NewAttribute(types.AttributeKeyAckError, ackErr.Error()))
    }

    ctx.EventManager().EmitEvent(
        sdk.NewEvent(
            types.EventTypePacket,
            eventAttributes...,
        ),
    )

    // NOTE: acknowledgement will be written synchronously during IBC handler execution.
    return ack
}
```

<HighlightBox type="note">

Observe in the previous example how we redirect to the module keeper's `OnRecvPacket` method and are constructing the acknowledgement to be sent back.

</HighlightBox>

### Acknowledging or timing out packets

A useful exercise is to try to find and analyze the code corresponding to this. The place to start is the packet callbacks, usually defined in a file like `module_ibc.go` or `ibc_module.go`.

<HighlightBox type="remember">

When a packet times out, the submission of a `MsgTimeout` is essential to get the locked funds unlocked again. As an exercise, try to find the code where this is executed.

</HighlightBox>

<HighlightBox type="synopsis">

To summarize, this section has explored:

* How IBC provides a reliable solution to the technical challenge of transferring fungible and non-fungible tokens between two different blockchains, freeing up great potential for cross-chain Decentralized Finance (DeFi) applications.
* How the process for transferring value differs based on whether or not the IBC tokens are native to the source chain, or whether or not they are being sent on a channel they were previously received on.

</HighlightBox>

repository: cosmos/sdk-tutorials

gha_language: JavaScript

gha_license_id: NOASSERTION

repo_name: cosmos/sdk-tutorials


text:
# Deprecation notice

This repository is no longer maintained. The `algoliasearch-jekyll` gem it was using has been deprecated in favor of [jekyll-algolia](https://github.com/algolia/jekyll-algolia).

You should check [this tutorial](https://community.algolia.com/jekyll-algolia/blog.html) to see how to build a front-end search that uses the `jekyll-algolia` plugin.

If you have any comments or questions, you should [open an issue](https://github.com/algolia/jekyll-algolia/issues) on the `jekyll-algolia` repository.

repository: jorgeponto/hyde

repo_name: jorgeponto/hyde


text:
# Readcomiconline-scraper

## Documentation

1. Edit `comics-parser.rb` and set the `$COMICS_URL` variable to the comics urls you want to download.

2. Run `bundle install`

3. Run `ruby comics-parser.rb`

4. The comics and their issues should appear in the current directory.

repository: tarraschk/readcomiconline-scraper

gha_language: Ruby

repo_name: tarraschk/readcomiconline-scraper


text:
# From Keyboard

To get the input from the keyboard, use the `DFKeyBoard` property.

The child elements of the Keyboard property have the names of any keys as properties.

Here is an example of its use in practice.

```cs
if (DFKeyBoard.A.IsPressed)
{
	Console.WriteLine("A is pressed");
}

if (DFKeyBoard.B.IsKeyDown)
{
	Console.WriteLine("B has just been pressed");
}

if (DFKeyBoard.B.IsKeyUp)
{
	Console.WriteLine("B has just been released");
}
```

repository: acid-chicken/DotFeather

gha_language: C#

gha_license_id: MIT

repo_name: acid-chicken/DotFeather


text:
---
layout: default
---

# 1997-05-15 - Re: `careerpunks'

## Header Data

From: Eric Murray<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 5d85dee10c550be460f80599bcf3b683d670936b07f9d14b537143808d2480d0

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1997-05-15 16:50:54 UTC

Raw Date: Fri, 16 May 1997 00:50:54 +0800

## Raw message

```
{% raw  %}From: Eric Murray<EMAIL_ADDRESS>Date: Fri, 16 May 1997 00:50:54 +0800
To<EMAIL_ADDRESS>Subject: Re: `careerpunks'
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Adam Shostack writes:
>
>
>
> Adam Back wrote:
> > Seems to me many of the `cypherpunks' have become `careerpunks' and
> > are now more interested in trading crypto tips, trade gossip, than in
> > cypherpunks projects.
> >
> > They went through the phase of buying kewl domain names (take a look
> > down the subscriber lists), tinkering with remailers, and have now
> > graduated to making money from crypto consulting, and lost interest in
> > the issues where they don't add to the bottom line.
>
> 	I disagree with your analysis.  I'm working for a number of
> large companies as a consultant.  At each of them, I think I've done
> things that substantially imrpove customer privacy.

Same here.  I've been looking out for privacy problems in the systems
that I help my clients design.  Whenever I find one I have been able to
convince the client to redesign their product to fix it.
I'd never have this much influence as a mere cypherpunk.  But when I
can tell the client what the damage will likely be if their systems
are not sufficiently private, they become very interested in making them so.

Also, working in the field doesn't preclude doing free stuff that
you find an interest in.

> 	Selling your services does not involve selling out.

Yes.  I will not work for a client on a project that I consider
to be 'bad' (i.e. GAK).   I do wonder sometimes what I will do if/when
all crypto systems are GAKware.

--
   Eric Murray<EMAIL_ADDRESS>       Privacy through technology!
  Network security and encryption consulting.    PGP keyid:E03F65E5

{% endraw %}
```

## Thread

+ Return to [May 1997](/archive/1997/05)

+ Return to "[Adam Shostack <adam@homeport.org>](/authors/adam_shostack_adam_at_homeport_org_)"
+ Return to "[Eric Murray <ericm@lne.com>](/authors/eric_murray_ericm_at_lne_com_)"

+ 1997-05-13 (Tue, 13 May 1997 20:22:39 +0800) - [Re: `careerpunks'](/archive/1997/05/15431ea1542e8c5747d7257fd2b6a699224720c202c41f06f8fea06da4bd7008) - _Adam Shostack<EMAIL_ADDRESS>  + 1997-05-15 (Fri, 16 May 1997 00:50:54 +0800) - Re: `careerpunks' - _Eric Murray<EMAIL_ADDRESS>


text:
# BoB Server Install Script
This script is a all in one install script for the dedicated server of Beasts of Bermuda.

It will automatically install Steam Command if needed, and setup the needed scripts to get a Beasts of Bermuda server running.

It, however, will not manage your firewall or your playerbase.

if you have any issues running it, use the provided batch script to setup your computer for running powershell scripts.

gha_language: PowerShell


text:
# devise-vero

[![Build Status](https://travis-ci.org/LoveMondays/devise-vero.svg)](https://travis-ci.org/LoveMondays/devise-vero)
[![Code Climate](https://codeclimate.com/github/LoveMondays/devise-vero/badges/gpa.svg)](https://codeclimate.com/github/LoveMondays/devise-vero)
[![Test Coverage](https://codeclimate.com/github/LoveMondays/devise-vero/badges/coverage.svg)](https://codeclimate.com/github/LoveMondays/devise-vero)
[![Dependency Status](https://gemnasium.com/LoveMondays/devise-vero.svg)](https://gemnasium.com/LoveMondays/devise-vero)

Add Vero support for an ActiveRecord object.
- Replace transaction emails sent by [Devise](https://github.com/plataformatec/devise) with [Vero](http://www.getvero.com) events.
- Unsubscribe the user once it's deleted from application.

Tested with devise ~3.4

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'devise-vero'
```

Run `bundle install`, and then run:

    rails generate devise:vero:install

To copy the default configuration file to your initializers directory.

## Usage

That's it

## Contributing

1. Fork it ( https://github.com/LoveMondays/devise-vero/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

repository: LoveMondays/devise-vero

repo_name: LoveMondays/devise-vero


text:
---
title: Separating states into modules with ngrx and Angular
date: 2018-01-25 18:40
author: Fabian Gosebrink
layout: post
tags: angular ngrx
logo: 'assets/images/logo_small.png'
navigation: true
cover: 'assets/images/aerial-view-of-laptop-and-notebook_bw_osc.jpg'
subclass: 'post tag-speeches'
disqus: true
categories: articles
---

In this blogpost I want to give you an explanation of the state tree of ngrx if you are working with a state and how to separate it into different modules.

## In this blog

1. [One state on you whole application with forRoot(...)](#forRoot)
2. [Separating state into modules with forFeature(...)](#forFeature)
3. [Conclusion](#conclusion)

If you are building smaller or large angular applications you will sooner or later face the problem to manage the state of your application. It gets influenced by a lot of things around which can be a simple buttons triggering a service - maybe with an http action - which will set your application in a different state.

## One state on you whole application with forRoot(...)

Lets take an applicationstate for the whole application which is just an object like this

```
{ customerList = [], currentlyLoading = false }
```

The apps application state interface then looks like

{% highlight js %}
interface ApplicationState {
    currentlyLoading: boolean;
    customerList: any []
}

export const initialState: ApplicationState = {
  currentlyLoading: false,
  customerList: []
};
{% endhighlight %}

A reducer could manipulate this state like

{% highlight js %}
export function appReducer(state: ApplicationState = initialState, action: Action) : ApplicationState {
    switch (action.type) {
        case ANYACTION:
            return {
                ...state,
                // modify properties here
            }
        // more actions
        default:
            return state;
    }
}
{% endhighlight %}

which we can use in our whole application like this:

{% highlight js %}
@NgModule({
  imports: [
    BrowserModule,
    StoreModule.forRoot({ applicationState: appReducer})
  ]
})
export class AppModule {}
{% endhighlight %}

So image you have the following angular application structure:

```
app
├── // modules, components and so on
├── app.component.ts
├── app.component.html
├── app.module.ts
└── main.ts
...
```

With the

{% highlight js %}
StoreModule.forRoot({ applicationState: appReducer})
{% endhighlight %}

`forRoot` statement we are applying the state which is the result of the appReducer on the application level. That means that the whole application knows this state and can react to its changes.

The state is now an object with a property called `applicationState` which has the value the appReducers gives us as an output.

But if we console.log out

{% highlight js %}
ngOnInit(): void {
    this.store.pipe(select<any>('applicationState'))
      .subscribe((appState: ApplicationState) => console.log(appState));
  }
{% endhighlight %}

the state we get the following result

`{currentlyLoading: false, customerList: Array(0)}`

So if we log out the initial state we will get back an object with two properties on it. But why is that? Shouldn't it be an object (the one from the `forRoot`) with a property on it called `applicationState`?

Well, the `select` method in the code sample above is literally selecting the property "applicationState" and giving us back the result which is itself an object with two properties `currentlyLoading` and `customerList` on it.

Our state however still is an object like this

```
{
    applicationState: {
            currentlyLoading: false,
            customerList: Array(0)
        }
}
```

Which we could log out with a statement like

{% highlight js %}
 ngOnInit(): void {
    this.store
      .select<any>((state: any) => state) // the complete state this time!!!
      .subscribe((completeState: any) => console.log(completeState));
  }
{% endhighlight %}

## Separating state into modules with forFeature(...)

So our application state will be influenced my many things we do. We would divide those actions and areas of our application into different modules. Also if you want to keep your application in a structured manner you will separeate it into different modules which provide you more maintainability and overview about what your application is really doing and where you have to search for things like components, maybe pipes, directives etc.

You would possibly introduce a module which encapsulates and abstracts all your customer related things. So you application _could_ look like this:

```
app
└── customers
    ├── components
    ├── containers
    ├── customer.routing.ts
    └── customer.module.ts
├── app.component.ts
├── app.component.html
├── app.module.ts
└── main.ts
...
```

So we created a customers folder where we have a place to put all the customer related stuff into. But now it would be an improvement if only the module itself track of its own state as it does this for its routes and so can fulfill the purpose of a completely seperated part of your application. Also concerning the state.

So we can apply our module state in a seperate module store which would be a seperate folder in the customers folder:

```
app
└── customers
    ├── components
    ├── containers
    └── store
        └── state/actions/reducers/effects...
    ├── customer.routing.ts
    └── customer.module.ts
├── app.component.ts
├── app.component.html
├── app.module.ts
└── main.ts
...
```

Now we can refactor our application state into the properties which are needed only on application level and not in a feature module because a feature module takes care of its state on its own. Therefore the feature module get its own state.

Ngrx provides a good mechanism for us to apply parts of the state to our main state. We already know the `forRoot()`  method which applies a state on root level. The `forFeature()` method is helping us out merging a state to the root level. So let's try that out: Our AppState is now an empty model (which could have properties however) and the customer store gets the whole properties:

{% highlight js %}
interface CustomerState {
    currentlyLoading: boolean;
    customerList: any []
}

export const initialState: CustomerState = {
  currentlyLoading: false,
  customerList: []
};
{% endhighlight %}

app.module.ts

{% highlight js %}
@NgModule({
  imports: [
    BrowserModule,
    StoreModule.forRoot({ /* an empty object here for this time */})
  ]
})
export class AppModule {}
{% endhighlight %}

customer.module.ts

{% highlight js %}
@NgModule({
  imports: [
    StoreModule.forFeature('customerFeature', {
      customer: customerReducer
    })
  ],
  exports: [],
  declarations: [],
  providers: []
})
export class CustomerModule {}
{% endhighlight %}

The customer reducer - customer is just a feature module name here - manipulates the whole customerstate now. As our AppState did exactly that before, we can just move the reducer into the customer feature module and rename all the things.

The interesting part is the `forFeature` method above. Lets take a look at this:

{% highlight js %}
StoreModule.forFeature('customerFeature', {
    customer: customerReducer
})
{% endhighlight %}

The `forFeature(...)` method merges an object to the root state which is only an empty object now. It takes the string and creates a property on the root state with that name which has an object itself with the property `customer` which itself again has the two properties from before. So our state would look like this now:

```
{
    customerFeature: {
        customer: {
            currentlyLoading: false,
            customerList: Array(0)
        }
    }
}
```

If we console log out the _complete_ state this time

{% highlight js %}
 ngOnInit(): void {
    this.store
      .select<any>((state: any) => state) // the complete state this time!!!
      .subscribe((completeState: any) => console.log(completeState));
  }
{% endhighlight %}

we get exactly that result:

```
{
    customerFeature: {
        customer: {
            currentlyLoading: false,
            customerList: Array(0)
        }
    }
}
```

The `select` method now again gives us the possibility to get a part of the state like this

{% highlight js %}
  ngOnInit(): void {
    this.store
      .select<any>('customerFeature')
      .subscribe((customerState: CustomerState) => console.log(customerState));
  }
{% endhighlight %}

we are selecting the property `customerFeature` and subscribing to that again. So the result of the console log looks like:

```
{
    customer: {
        currentlyLoading: false,
        customerList: Array(0)
    }
}
```

which would be the same result as we subscribe to the state like

{% highlight js %}
  ngOnInit(): void {
    this.store
      .select<any>((state: any) => state.customerFeature) // no strings here
      .subscribe((customerState: CustomerState) => console.log(customerState));
  }
{% endhighlight %}

## Conclusion

So with the `forFeature(...)` method you can build your state object exactly that modular like you do it with your whole application. Which makes seperation of concerns and not mixing thins very easy and well structured.

Of course all the `any`s can and probably should be replaced with interfaces to be type safe. ;)

You can see examples of states with multiple modules here: [https://github.com/FabianGosebrink/ASPNETCore-Angular-Ngrx](https://github.com/FabianGosebrink/ASPNETCore-Angular-Ngrx)


text:
# Change Log

## Semantic Versioning
https://semver.org/

## [v1.2.0] - 2018-06-11
> feat(findOptions): added IN operator
- added Entity [findAll/findOne]: Acepts IN root operators.
- added Documentation [FindOptions]: IN Examples and Query Generated.

## [v1.1.0] - 2018-06-10
> feat(findOptions): added OR and AND operator
- added Entity [findAll/findOne]: Acepts AND and OR root operators.
- added Documentation [FindOptions]: AND/OR Examples and Query Generated.

## [v0.9.0] - 2018-06-02
> feat(Entity): added destroy/destroyAll function
- added Entity [destroy]: deletes with where parameter.
- added Documentation [Entiry]: API example and query generated.

## [v0.8.0] - 2018-06-02
> feat(Entity): findAll/findOne added limit and offset option
- added Entity [findAll/findOne]: Acepts limit and offset, it can be used with orderBy aswel.
- added Documentation [FindOptions]: Limit/Offset Examples and Query Generated.

## [v0.7.0] - 2018-06-02
> feat(Entity): findAll/findOne added orderBy option
- added Entity [findAll/findOne]: Acepts orderBy option.
- added Documentation [FindOptions]: OrderBy Examples

## [v0.6.0] - 2018-06-02
> feat(Entity): added update function
- added Entity [update]: updates the values of persted entity.
- change Entity [create]: refactored create parser to simplify unit tests.
- added UnitTest [createParser]: minimum test to check query generated.
- added UnitTest [updateParser]: minimum test to check query generated.
- added Documentation [API example]: save function example.
- added Documentation [API example]: Query example.

## [v0.5.0] - 2018-06-02
> change(Entity): create now return the inserted Values
- change Entity [create]: now returns the inserted values as entity
- change Entity [create]: simplified the INSERT query. now do not use PROCEDURE anymore.
- fix Entity [mapping]: change storedValue to not enumerable to keep result clean.

## [v0.4.0] - 2018-06-02
> feat(ConnectionManager): added logging option
- added ConnectionManager [logging]: configuration to log the query generated

## [v0.3.0] - 2018-05-31
> feat(Entity): create 'findOne' function with where filter
- added Entity [findOne]: with where filter
- added Documentation [Getting Started]: minimal instalation and usage guid.
- added Documentation [ConnectionManage example]: minimal instruction and the usage of it's config.
- added Documentation [API example]: minimal API usage guid.

## [v0.2.0] - 2018-05-31
> feat(Entity): update 'Create' function with PrimaryKey and Sequence Decorators
- added Decorator[PrimaryKey]: create Function now returns primaryKey value
- added Decorator[Sequence]: 'Create' function uses Squence on Create
- added Entity: findAll unit tests

## [v0.1.3] - 2018-05-27
> feat(Entity): Minimal FindAll and Create function
- added Decorator[Table]: declare table name at Entity
- added Decorator[Column]: declare column name, and dataTypes
- added Entity: findAll with AND filter
- added Endity: create with value function
- fix Library: Exports

repository: oscbt/relax-orm

repo_name: oscbt/relax-orm


text:
# History

The History view allows to look at the list of recents commits on the project.

Your project files can be restored to any commit by clicking on the ``Restore`` button.

repository: umi-academy/pxt

gha_language: TypeScript

repo_name: umi-academy/pxt


text:
# TCScurriculum
Repo to hold projects and images for [The Coding School](https://the-cs.org) Curriculums. All projects are in Python3. Corresponding Lessons and Project instructions are located in the Google Drive.

## Project List
1. **Poker** - User implements the game of poker in the command line
2. **Dungeon Crawler** - Dungeon explorer using BFS & DFS
3. **Maze Generator** - Generate and solve mazes
4. **Fractals & Automatons** -
5. **Hospital Scheduler** - Use graph coloring concepts to create an appointment scheduler
6. **Sudoku** - Solve sudoku puzzles using constraint propogation
7. **Knapsack Problem** - Solve the Knapsack Problem using recursive and dynamic programming methods
8. **Text Generation** - Use N-Gram Models to generate text based off of Green Eggs & Ham by Dr. Seuss
9. **Walking Dead** - Use the `heapq` Python3 module to figure out what order to kill the approaching zombies in

repository: itsEmShoji/TCScurriculum

repo_name: itsEmShoji/TCScurriculum


text:
# The Expression Grammar

This document has ideas about the dot expressions for the j2m system.

# Rules

The following rules specify how the JSON is transformed into markup:

1. A JSON object will be transformed into markup
2. @ is a prefix for a markup attribute, e.g. @class, @id, @style, etc.
3. $number is a prefix that specifies the instance number of an element, e.g. $0tr, $1td, etc.
4. $str is a property whose value is plain text
5. Arrays are used to replicate elements with a single tagName specified by the property that owns the array, e.g. tr: [ ... ] will create multiple <tr> elements
6. You can use dot expressions in the property names as a shorthand notation. The elements will be recursively created.

# Usages

Why do we need the grammar? Where will it be used? Here are the 3 usages of the grammar:

1. Using the expressions in mapping JSON to markup
2. Using the expressions to query JSON arbitrarily
3. Using the expressions to map between source JSON and target JSON (for transforming JSON)

# Grammar

The following grammar defines the rules for parsing the dot expressions.

The grammar below conforms to these simple rules:

0. Each production is listed on a separate line.
1. Left hand terms are the names of the productions.
2. Right hand terms are the items that the productions evaluate to.
3. The grammar productions are declared as: Left hand term := Right hand term
4. Right hand terms can be grouped using parentheses, i.e. ( ... ), where the ellipsis is replaced by actual terms.
5. Literals may only appear as Right hand terms and must be contained within single quotes, i.e. '...', where the ellipsis is replaced by actual literal text.
6. The ! character is used to express that any character will match EXCEPT FOR the succeeding item, i.e. !Dot means that all characters are valid except for Dot.
7. The | character is used to signify a logical OR between terms, i.e. A := B | C | D means that A evaluates to B or A evaluates to C or A evaluates to D.
8. The & character is used to signify a logical AND between terms. This is typically used with the ! (see rule #4 above), e.g. A := !B & !C & !D which means that A cannot evaluate to B, C or D, i.e. A can be anything else.
9. The single quote character is used to bound literal text, i.e. '@' is interpreted as the literal @ character.
10. The + character is used to express that the preceding item is to occur 1 or more times, i.e. A+ means that the A production must occur 1 or more times, or 'x'+ means that the x character must occur 1 or more times.
11. The * character is used to express that the preceding item is to occur 0 or more times, i.e. A* means that the A production may occur 0 or more times, or 'x'* means that the x character may occur 0 or more times.
12. The ? character is used to express that the preceding item may occur 0 or 1 time only, i.e. A? means that the A production may occur 0 or once, or 'x'? means that the x character may occur 0 or once.

*Dot Expression Grammar for Usage 1 (see below)*

```
Expression := ( ExpressionPiece ( Dot ExpressionPiece )* )

Dot := '.'

ExpressionPiece := NumberPrefixedElement | Attribute | Element | StringElement

Attribute := ( '@' Usage1Char+ )

Element := Usage1Char+

NumberPrefixedElement := ( '$' Digit+ Element )

StringElement := '$str'

Digit := ( '0' - '9' )

Usage1Char := ( !Dot & !Wildcard & !SingleObjectPlaceholder & !'=' & !'@' & !'[' & !']')

Wildcard := '*'

SingleObjectPlaceholder := '?'
```

*Dot Expression Grammar for Usages 2 and 3 (see below)*

There are changes to the Grammar for Usage 1 that need to be made to support Usages 2 and 3. The changes are:

```
ExpressionPiece := Wildcard | SingleObjectPlaceholder | NumberPrefixedElement | Attribute | Element | StringElement

Attribute := ( '@' Char+ )

BoundedAttributeExpression := '[' Attribute '=' Char+ ']'

BoundedAttributeDeclaration := '[' Attribute ']'

BoundedElementExpression := '[' ElementName '=' Char+ ']'

BoundedElementDeclaration := '[' ElementName ']'

ArrayIndex := '[' ( Digit+ | '*' ) ']'

Element := ElementName ElementTail?

ElementName := (Char & !Digit) Char*

ElementTail := ( BoundedAttributeExpression | BoundedAttributeDeclaration | BoundedElementExpression | BoundedElementDeclaration | ArrayIndex )+

Char := ( !Dot & !'=' & !'@' & !'[' & !']' & !Wildcard & !SingleObjectPlaceholder )

Wildcard := '*' ElementTail?

SingleObjectPlaceholder := '?' ElementTail?
```

The complete grammar for Usages 2 and 3 is:

```
Expression := ( ExpressionPiece ( Dot ExpressionPiece )* )

Dot := '.'

ExpressionPiece := Wildcard | SingleObjectPlaceholder | NumberPrefixedElement | Attribute | Element | StringElement

Attribute := ( '@' Char+ )

BoundedAttributeExpression := '[' Attribute '=' Char+ ']'

BoundedAttributeDeclaration := '[' Attribute ']'

BoundedElementExpression := '[' ElementName '=' Char+ ']'

BoundedElementDeclaration := '[' ElementName ']'

ArrayIndex := '[' ( Digit+ | '*' ) ']'

Element := ElementName ElementTail?

ElementName := (Char & !Digit) Char*

ElementTail := ( BoundedAttributeExpression | BoundedAttributeDeclaration | BoundedElementExpression | BoundedElementDeclaration | ArrayIndex )+

NumberPrefixedElement := ( '$' Digit+ Element )

StringElement := '$str'

Digit := ( '0' - '9' )

Char := ( !Dot & !'=' & !'@' & !'[' & !']' & !Wildcard & !SingleObjectPlaceholder )

Wildcard := '*' ElementTail?

SingleObjectPlaceholder := '?' ElementTail?
```

# Examples of Valid Expressions

Regarding the expressions, here are some points to remember:

1. The wildcard (i.e. the '*' character) can be used to signify any object or any nested set of objects.
2. In addition, the '?' character can be used to signify a single object.

Here are a few examples of valid expressions:

Example #1: The following will match any JSON property whose key is 'table'

```
table
```

Example #2. The following will match only the first JSON property whose key is 'table'

```
$0table
```

Example #3. The following will match only the second JSON property whose key is 'table'

```
$1table
```

Example #4. The following will match all tr properties within any table

```
table.tr
```

Example #5. The following will match all 'class' attributes of 'tr' elements in 'table' elements

```
table.tr.@class
```

Example #6. The following will match all properties

```
*
```

Example #7. The following will match any property whose key is 'foo' that is contained within any object (i.e. it is not top-level)

```
*.foo
```

Example #8. The following will match any property whose key is 'foo' that is contained within any object that is also contained within any other object (i.e. it is not top-level or 2nd-level)

```
*.*.foo
```

Example #9. The following will match any property whose key is 'foo' that is contained within a top-level object

```
?.foo
```

Example #10. The following will match any property whose key is 'foo' that is contained within a 2nd-level object

```
?.?.foo
```

Example #11: The following will match the first property whose key is 'tr' that is contained within an object whose property key is 'table'

```
table.$0tr
```

Example #12: The following will match the second 'tr' of the first 'table' that has an '@class' property whose value is 'some-class'. In this example, please note how it is possible to use array indexing (i.e. [0]) on the result of a prior expression (i.e. table[@class=some-class]).

```
<EMAIL_ADDRESS>```

Example #13: The following will match all properties whose key is 'foo' that contain a '@baz-attr' property.

```
foo[@baz-attr]
```

Example #14: The following will match all properties whose key is 'foo' that contain a 'bar' property.

```
foo[bar]
```

Example #15: The following will match all properties who key is 'foo' that contain a 'bar' property whose value is 'some-value'

```
foo[bar=some-value]
```

Example #16: The following will match the third element in 'foo'

```
foo[2]
```

Example #17: The following will match all the elements in 'foo'

```
foo[*]
```

# Caveats

There are some restrictions to using the expressions based on the different usages.

Usages
------

1. Using the expressions in mapping JSON to markup
2. Using the expressions to query JSON arbitrarily
3. Using the expressions to map between source JSON and target JSON (for transforming JSON)

Restrictions for Usage 1
------------------------

1. The use of wildcard or single object matchers, i.e. the '*' or '?' characters, is not allowed when mapping JSON to markup.
2. It is assumed that each object is specifying a single matching object, i.e. ```table``` will match only 1 property whose key is 'table'.

Restrictions for Usage 2
------------------------

1. Wildcards and single object matchers are allowed.
2. Specifying a name means that you want to match against ALL properties whose key matches the name, e.g. ```foo``` will match all properties whose key is ```foo``` regardless of their position in the object graph.
3. You must use $number expressions to specify a specific object when there are many with the same property key among siblings.

Restrictions for Usage 3
------------------------

*The same as the Restrictions for Usage 2 above*

# Limitations

It is obvious that these expressions will be useful for quick referencing of sub-sections of an object graph. However, it is also limited in the degree of complexity that can be applied. The more thorough way to query the object graph will be to use code. This could be done via some function, F, that is run against an object, O, to produce a query result, R. In formal terms:

```
F + O -> R
```

The implementation of F would traverse O to produce R. That, however, lies outside the scope of the expressions.

repository: kmati/friedjuju

repo_name: kmati/friedjuju


text:
---
layout: post
title: Write Journal is live now!
subtitle: Write Journal - A blog dedicated to helping people have a better life by writing personal journals.
tags: [writing, journal, diary]
comments: true
---

![Write Journal](/img/post/write-journal-is-live.jpg)

Hello world! **WriteJournal.com(a blog dedicated to helping people have a better life by writing personal journals)** is finally live. We will be publishing blog articles about writing, personal journal, online diary, and more to help you get the writing habit that can make your life better.

repository: ohsik/writejournal-jekyll

repo_name: ohsik/writejournal-jekyll


text:
Nimdeps is a [Nim](https://nim-lang.org/) package to bundle dependency files into the generated executable.

It is very common to have external dependency files such as data files, graphics and other payloads as part of an application. Nimdeps makes it easy to carry all this payload within the application binary instead of having to build a separate installer.

All dependencies get packaged into the application binary at compile time. All references to dependencies need to be relative to the application project directory at compile time. At runtime, all files are checked for existence and extracted if not already present or changed. Dependencies get extracted relative to the application location at runtime.

__Installation__

Nimdeps can be installed via [Nimble](https://github.com/nim-lang/nimble):

```
> nimble install nimdeps
```

This will download and install nimdeps in the standard Nimble package location, typically ~/.nimble. Once installed, it can be imported into any Nim program.

__Usage__

Module documentation can be found [here](http://genotrance.github.io/nimdeps/nimdeps.html).

```nim
import nimdeps

const FILES = @["data.dat", "icon.png"]
setupDepFiles(FILES)

setupDepDir("depDir1")

<EMAIL_ADDRESS>"depDir2"])
```

NOTE: Nimdeps should be invoked prior to loading any of the dependencies so that they are extracted prior to usage. At this time, DLL files are not supported if they are loaded using the `{.dynlib.}` pragma since Nim loads such libraries prior to nimdeps running. Likewise if they are linked with `-l` since the OS checks for them at load time. This can be avoided by manually loading the DLL using the `dynlib` module or lazily loaded using the [lazylib](https://github.com/genotrance/lazylib) package.

__Feedback__

Nimdeps is a work in progress and any feedback or suggestions are welcome. It is hosted on [GitHub](https://github.com/genotrance/nimdeps) with an MIT license so issues, forks and PRs are most appreciated.

repository: genotrance/nimdeps

repo_name: genotrance/nimdeps


text:
# AddressToGPS
AddressToGPS is a open source tool to search for an address, location, or area using the Google Maps javascript API.
Once you have selected a location you then can get the coordinates and open the location in a maps app (OsmAnd).
This tool does not require your location, only an internet connection.


text:
# terraform-provider-solace

[![Build Status](https://travis-ci.org/ExalDraen/terraform-provider-solace.svg?branch=master)](https://travis-ci.org/ExalDraen/terraform-provider-solace)
[![Go Report Card](https://goreportcard.com/badge/github.com/ExalDraen/terraform-provider-solace)](https://goreportcard.com/report/github.com/ExalDraen/terraform-provider-solace)
[![GoDoc](https://godoc.org/github.com/ExalDraen/terraform-provider-solace/solace?status.svg)](https://godoc.org/github.com/ExalDraen/terraform-provider-solace/solace)

## Table of Contents

- [terraform-provider-solace](#terraform-provider-solace)
  - [Using A Binary Package](#using-a-binary-package)
  - [Building The Provider From Source](#building-the-provider-from-source)
  - [Developing the Provider](#developing-the-provider)
  - [Documentation](#documentation)

[Terraform](https://www.terraform.io) provider plugin for managing [Solace](https://solace.com/) appliances using the [Solace SEMP v2 API](https://docs.solace.com/SEMP/Using-SEMP.htm).

## Using the Binary Packages

Download the [release binary](https://github.com/ExalDraen/terraform-provider-solace/releases) from and copy it to `$HOME/terraform.d/plugins/<os>_<arch>/terraform-provider-solace` as explained in the [terraform docs](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins).

For example, in a Linux environment you would copy it to `/home/youruser/terraform.d/plugins/linux_amd64/terraform-provider-solace`, for a MacOS environment to `/Users/youruser/terraform.d/plugins/darwin_amd64/terraform-provider-solace`.

## Building The Provider From Source

Clone repository to: `$GOPATH/src/github.com/ExalDraen/terraform-provider-solace`

```sh
mkdir -p $GOPATH/src/github.com/ExalDraen; cd $GOPATH/src/github.com/ExalDraen
git clone git@github.com:ExalDraen/terraform-provider-solace
```

Enter the provider directory and build the provider

```sh
cd $GOPATH/src/github.com/ExalDraen/terraform-provider-solace
make
```

## Developing the Provider

If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.8+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.

To compile the provider, run `make`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.

```sh
$ make build
...
$ $GOPATH/bin/terraform-provider-solace
...
```

### Testing the Provider

To run acceptance tests you will need to run a local solace instance. Once the instance is running you will need to export the following environment variables.

```sh
export SOLACE_USER="admin"
export SOLACE_PASSWORD="alex"
export SOLACE_HOST="localhost:8080"
```

You can then run the acceptance tests with

```sh
TF_ACC=1 make test
```

## Documentation

The provider very closely mirrors the SEMPv2 API, including resource and attribute names. In most cases, the name of attributes and resources is the same as in the SEMP API, with `snake_case` instead of `CamelCase`. For example `max_connection_count` instead of `MaxConnectionCount`.

See [examples/main.tf](examples/main.tf) for some usage examples.

## Configuration

The provider may be configured using terraform as normal, e.g.

```hcl
provider "solace" {
    host = "localhost:8080"
    base_path = "/SEMP/v2/config"
    user = "admin"
    password = "alex"
    msg_vpn = "go-tf-1"
}
```

or using the corresponding `SOLACE_*` environment variables. Check `provider.go` to see which variables are available.

repository: ExalDraen/terraform-provider-solace

repo_name: ExalDraen/terraform-provider-solace


text:
# Introduction

## Motivation

[Reactive Streams](http://www.reactive-streams.org/) are the key to build asynchronous, data-intensive applications with
no predetermined data volumes. By enabling non-blocking backpressure, they boost the resiliency of your systems by design.
@extref[Akka Streams](akka-docs:scala/stream/index.html) is a widely used toolkit that internally implements the
Reactive Streams JVM specification, whilst offering a much more user-friendly API.

But how do you tune and debug such applications? Two main challenges make monitoring Akka Streams application very different
(and somehow trickier) then traditional applications.

1. **non-linearity**: Akka Streams stages are not functions. Each stage's inputs and outputs are uncorrelated: zero/one input
can produce multiple (potentially infinite) outputs. Conversely, multiple inputs can produce fewer (potentially zero) outputs.
This makes measuring key metrics such as throughput and latency more challenging, as there is no generic way to determine
when an event has been processed.

2. **backpressure**: Akka Streams stages are backpressure-enabled. This means that, in a multi-stage pipeline, the slower
stage will determine the throughput of the whole pipeline. This is the whole point of Reactive Streams, allowing your
pipeline to go "as fast as possible, but not faster". However, this gets in the way of effectively looking for bottlenecks,
as there is no clear way of understanding what is backpressuring and what's not.

Whilst Akka Streams doesn't currently provide a comprehensive solution to these issues, it exposes a low-level API that
allows to perform custom actions when _push_ and _pull_ signals are sent to a stage. This library leverages this API.
For more details on this, check out @extref[this section](akka-docs:/stream/stream-customize.html) of the Akka Streams
documentation.

## What this library does

_Akka Streams Checkpoint_ attempts to overcome the two challenges above. It allows to create generic, pass-through stages
that can be placed at meaningful points in your pipeline.

### Throughput
Throughput is the measurement of how many events are processed by your pipeline in a unit of time. Because of non-linearity,
measuring the throughput of a whole pipeline might not necessarily be helpful. Each section of your pipeline can have a
different throughput, and it is up to the developer to determine what's meaningful and what's not.

A _checkpoint_ placed in a pipeline will be notified each time an element is pushed out of it, allowing the backend to record
the event accordingly.

@@@ note

Throughputs can also be aggregated to record "relative" throughputs. A ratio between throughputs measured at two different
points in your pipeline will give you an idea of how many events are dropped/conflated (if the ratio is lower than 100%)
or how many are generated/expanded (if the ratio is higher than 100%). Dashboard tools like [Grafana](https://grafana.com/)
and [Datadog](https://www.datadoghq.com/) allow to compose series.

@@@

### Pull-push and push-pull latency
Each _checkpoint_ is a linear stage that emits downstream all the elements which are pushed from upstream. This means that
for each pull from downstream, there will be a push from upstream.
Latency is being measured:

- _between a push and the last pull_: this will give us a reading of how much time the upstream takes to produce an element after
it's been requested
- _between a pull and the last push_: this will give us a reading of how time the downstream takes to request an element after
the previous element has been emitted

### Backpressure ratio
A _checkpoint_ can be in one of two working states:

- _backpressuring_: the checkpoint is waiting for a pull from the downstream
- _NOT backpressuring_: the checkpoint is waiting for a push from the upstream

The _backpressure ratio_ metric measures the percentage of time spent by the checkpoint in the backpressuring state. A high
backpressure ratio indicates that a bottleneck is present downstream of the checkpoint.

### Liveness
Backpressured systems can suffer from liveness issues. These can have a variety of causes, ranging from an unresponsive
third party, all the way to @extref[code bugs](akka-docs:/stream/stream-graphs.html#graph-cycles-liveness-and-deadlocks).
In case of a liveness issue, no demand will flow from downstream to upstream. This will cause all the metrics
previously described to fall silent. To solve this issue, each _checkpoint_ keeps a basic flag counter that represents
if the _checkpoint_ is currently backpressured. Because of its simplicity, this metric becomes meaningful in case of
liveness issues.

## What this library does NOT

### Error tracking
_Akka Streams Checkpoint_ does not currently offer a way to record errors or completion events happening in the pipeline.
Check out @extref[these stages](akka-docs:/stream/operators/index.html#watching-status-stages)
already provided by Akka Streams for these purposes.

### Trace context
_Akka Streams Checkpoint_ is not a solution to allow tracing of context in Akka Streams applications. However, the
checkpoints provided by this library are completely transparent and should be able to coexist with any pipeline model,
including trace context.

repository: akara/akka-stream-checkpoint

repo_name: akara/akka-stream-checkpoint


text:
### [CVE-2021-24604](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-24604)
![](https://img.shields.io/static/v1?label=Product&message=Availability%20Calendar&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=1.2.2%3C%201.2.2%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-79%20Cross-site%20Scripting%20(XSS)&color=brighgreen)

### Description

The Availability Calendar WordPress plugin before 1.2.2 does not sanitise or escape its Category Names before outputting them in page/post where the associated shortcode is embed, allowing high privilege users to perform Cross-Site Scripting attacks even when the unfiltered_html is disallowed

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/p1ay8y3ar/cve_monitor

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# Server

The server has two components, one to check on queue status and one
to present the status to clients.

# Queue Status

`condor_q` is used to retrieve the queue status (idle jobs). Attributes
recorded are:

* RequestCPUs
* RequestMemory
* RequestDisk
* RequestGPUs
* OpSysAndVer

This is on a timer to refresh once every 5 minutes.

# Web Server

A web server is used to display the queue status to the world. Clients
use jsonrpc over http to get the entire queue status.

A standard http view is also available for human monitoring:

![http view](list_of_requirements.png)

repository: WIPACrepo/pyglidein

gha_language: Python

repo_name: WIPACrepo/pyglidein


text:
---
layout: post
title: London Web Performance March
preview: My notes from London Web Performance's March event - Responsive and Fast by Michael Gooding and Ellen van Keulen from Akamai.
date: 2015-03-04 20:59:38
categories:
- notes
- perfmatters
- webperf
- performance
---

## Responive and Fast - [Michael Gooding](https://twitter.com/Michael_G_81) and [Ellen van Keulen](https://twitter.com/evankeulen)

[slides available on speaker deck](https://speakerdeck.com/mgooding1981/ldn-web-perf-rwd-and-fast-iterating-live)

- Display cost = bytes per pixel
- Images are a big offender, no images can half the load time of a page
- Responsive images can save on average 70% of our image weight (image weight being 2/3rd page weight usually)
- Srcset, picture element, and client hints are available to us in various browsers
- For picture element, take a look at [Scott Jehl's PictureFill](https://github.com/scottjehl/picturefill)
- `display:none;` images are still downloaded, even though they're not displayed
- Use js to add src for images that might be hidden on certain sizes
- Be careful with JS added images, can't be found with pre-parsers
- Consider lazy loading images that are significantly below "the fold" in product listing pages etc
- What worked for one site may not work for another site
- Look at [Paul Kinlan's Chrome Bookmarklet](https://gist.github.com/PaulKinlan/6284142) for analysing critical CSS ([video demo](http://addyosmani.com/blog/detecting-critical-above-the-fold-css-with-paul-kinlan-video/))
- Unused JavaScript (like image gallery stuff) - don't load it
- Conditionally load the JS you need using JS
- [SPOF-O-Matic](https://chrome.google.com/webstore/detail/spof-o-matic/plikhggfbplemddobondkeogomgoodeg) to disable certain scrips to see what effects they have on load
- [DOM Monster plugin](https://chrome.google.com/webstore/detail/dom-monster/hlimphkgopfdlelabkioalhfjfblnclk) can give hints on markup bloat
- You *can* use UA sniffing to implement RESS and reduce the page load (*personally I wouldn't advise it though*)
- Consider alternative formats to "just JPEG" for images. Picture element can help
- Bonus: Adjust image quality based on network conditions
- Aim to get your RWD site on mobile to be as light as a typical `m.` site
- Free [Responiveonsive and Fast](http://bit.ly/rf-free) eBook

- Incoming network information API could be useful
- [http://edgeconf.com](http://edgeconf.com)

repository: mstrutt/jekyll-portfolio

branch_name: refs/heads/develop

extension: markdown

repo_name: mstrutt/jekyll-portfolio


text:
---
id: upgrading
title: Upgrading + Changelog
---

# Upgrading TNS + Changelog

## `3.x.x` to `4.x.x`

TNS `4.x.x` supports **TypeScript >=3.3.1 <4.1.0** and supports **webpack 5**

Simply upgrade the package to get all the latest features:

```sh
# install version 4.x.x of `typescript-node-scripts`
yarn upgrade<EMAIL_ADDRESS>```

## `3.0.x` to `3.1.x`

TNS `3.1.x` supports **TypeScript 3.7** with its new language features.

Additionally, ESLint packages are now moved internally so you don't have to manage them by yourself. This means that you can remove the following packages in your `package.json`

- `@typescript-eslint/eslint-plugin`
- `@typescript-eslint/parser`
- `eslint`
- `babel-eslint`
- `eslint-plugin-import`

```sh
# npm
npm uninstall @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint babel-eslint eslint-plugin-import

# yarn
yarn remove @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint babel-eslint eslint-plugin-import
```

Additionally, path mapping is now an opt-in feature and not generated in the initial `create` command.

## `2.x.x` to `3.x.x`

### `3.x.x` Breaking Changes

Versions `1.x.x` up to `2.x.x` of `typescript-node-scripts` used TSLint as the default linter.
However, [TSLint has announced that it will be deprecated sometime in 2019](https://github.com/palantir/tslint/issues/4534), and packages that use TSLint should migrate to use ESLint.

Version `3.x.x` of `typescript-node-scripts` will now use ESLint instead of TSLint to lint your project.

### Automatic Migration via CLI

We've included a migration script so that you can migrate your TSLint configuration to ESLint configuration without heavylifting, and installs the necessary base packages to make your project ESLint compatible.

```sh
# go to your project root
cd <app_directory>

# install version 3.x.x of `typescript-node-scripts`
yarn upgrade<EMAIL_ADDRESS>
# run the migration script
npx typescript-node-scripts migration/tslint-to-eslint
```

You're done! Be sure to go through the console output so that you can see what potential issues that needs to be addressed.

### Gotchas

Since there is a disparity between ESLint and TSLint rules and plugins, custom added TSLint rules and plugins has to be migrated to ESLint **manually**.

> If you are using the default `tslint.json` generated with `typescript-node-scripts`, you shouldn't need to do anything more than running the migration script.

TypeScript support in ESLint is supported by the [`typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint) toolchain, and you should take a look at the repository to find out how to migrate your rules and plugins manually.

Additionally, tools like [`tslint-to-eslint-config`](https://github.com/typescript-eslint/tslint-to-eslint-config) can aid in converting your custom TSLint rules to ESLint-compatible rules.

### Adding Prettier

A lot of projects use Prettier, and here's a short guide on how to get Prettier up and running with ESLint.

> Be sure that you have already ran the migration script above, have Prettier installed, and have an existing `.prettierrc` already in your project root.

1. Install the ESLint plugins:

```sh
yarn add eslint-config-prettier eslint-plugin-prettier --dev
```

2. Modify `extends` in `.eslintrc.json`:

```diff
    "extends": [
        "eslint:recommended",
+       "prettier"
    ],
    "overrides: [
        {
            "extends": [
                "plugin:@typescript-eslint/recommended"
+               "prettier",
+               "prettier/@typescript-eslint"
            ]
        }
    ]
```

repository: liangchunn/typescript-node-scripts

repo_name: liangchunn/typescript-node-scripts


text:
# MarkdownView

[![CI Status](http://img.shields.io/travis/keitaoouchi/MArkdownView.svg?style=flat)](https://travis-ci.org/keitaoouchi/MarkdownView)
[![Swift 5.2](https://img.shields.io/badge/Swift-5.2-orange.svg?style=flat)](https://swift.org/)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](https://img.shields.io/cocoapods/v/MarkdownView.svg?style=flat)](http://cocoapods.org/pods/MarkdownView)
[![License](https://img.shields.io/cocoapods/l/MarkdownView.svg?style=flat)](http://cocoapods.org/pods/MarkdownView)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)

> MarkdownView is a WKWebView based UI element, and internally use markdown-it, highlight-js.

![GIF](https://github.com/keitaoouchi/MarkdownView/blob/master/sample.gif "GIF")

## How to use

#### UIViewController

```swift
import MarkdownView

let md = MarkdownView()
md.load(markdown: "# Hello World!")
```

#### SwiftUI

```swift
import SwiftUI
import MarkdownView

struct SampleUI: View {
  var body: some View {
    ScrollView {
      MarkdownUI(body: markdown)
        .onTouchLink { link in
          print(link)
          return false
        }
        .onRendered { height in
          print(height)
        }
    }
  }

  private var markdown: String {
    let path = Bundle.main.path(forResource: "sample", ofType: "md")!
    let url = URL(fileURLWithPath: path)
    return try! String(contentsOf: url, encoding: String.Encoding.utf8)
  }
}

```

### Options

```swift
md.isScrollEnabled = false

// called when rendering finished
md.onRendered = { [weak self] height in
  self?.mdViewHeight.constant = height
  self?.view.setNeedsLayout()
}

// called when user touch link
md.onTouchLink = { [weak self] request in
  guard let url = request.url else { return false }

  if url.scheme == "file" {
    return false
  } else if url.scheme == "https" {
    let safari = SFSafariViewController(url: url)
    self?.navigationController?.pushViewController(safari, animated: true)
    return false
  } else {
    return false
  }
}
```

### Experimental Features

This is not stable :bow:

#### Custom CSS Styling

Please check [Example/ViewController/CustomCss.swift](https://github.com/keitaoouchi/MarkdownView/blob/master/Example/Example/ViewController/CustomCss.swift).

#### Plugins

Please check [Example/ViewController/Plugins.swift](https://github.com/keitaoouchi/MarkdownView/blob/master/Example/Example/ViewController/Plugins.swift).
Each plugin should be self-contained, with no external dependent plugins.

[Here](https://github.com/keitaoouchi/markdownview-sample-plugin) is a sample project that builds `markdown-it-new-katex` as a compatible library.

## Requirements

| Target            | Version |
|-------------------|---------|
| iOS               |  => 13.0 |
| Swift             |  => 5.2 |

## Installation

MarkdownView is available through [Swift Package Manager](https://swift.org/package-manager/) or [CocoaPods](http://cocoapods.org) or [Carthage](https://github.com/Carthage/Carthage).

### Swift Package Manager

```swift
dependencies: [
    .package(url: "https://github.com/keitaoouchi/MarkdownView.git", from: "1.7.1")
]
```
Alternatively, you can add the package directly via Xcode.

### CocoaPods

```ruby
pod "MarkdownView"
```

### Carthage

```
github "keitaoouchi/MarkdownView"
```

for detail, please follow the [Carthage Instruction](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos)

## Author

keita.oouchi<EMAIL_ADDRESS>
## License

[bootstrap](http://getbootstrap.com/) is licensed under [MIT license](https://github.com/twbs/bootstrap/blob/v4-dev/LICENSE).
[highlight.js](https://highlightjs.org/) is licensed under [BSD-3-Clause license](https://github.com/isagalaev/highlight.js/blob/master/LICENSE).
[markdown-it](https://markdown-it.github.io/) is licensed under [MIT license](https://github.com/markdown-it/markdown-it/blob/master/LICENSE).

MarkdownView is available under the MIT license. See the LICENSE file for more info.

repository: keitaoouchi/MarkdownView

gha_language: Swift

repo_name: keitaoouchi/MarkdownView


text:
**You're viewing a file in the SMAPI mod dump, which contains a copy of every open-source SMAPI mod
for queries and analysis.**

**This is _not_ the original file, and not necessarily the latest version.**
**Source repository: https://github.com/NeroYuki/StardewSurvivalProject**

----

//TODO: Add more things to this</br>

Currently a heavy WIP, for now hunger and thrist function as well as items and machines support these mechanics should work fine. </br>

To add more healing item (including vanilla items), edit healingItemData.json with the format provided by example items </br>
To alter hydration value on drinkable item (including vanilla items), edit customHydrationData.json with the format provided by example items </br>

repository: Pathoschild/smapi-mod-dump

repo_name: Pathoschild/smapi-mod-dump


text:
---
author: agnieszka
tags:
  - code review
date: 2018-06-27T22:00:00.000Z
title: Self code review
layout: post
image: /images/blog_post_self_code_review.png
hidden: false
published: true
language: en
---
Once I was a child my parents were convincing me that it was worth double checking both my homework as well as tests before handing them in, to catch errors and fix them. It soon became a habit for me. The habit that once evaluated into a self code review process :)

![checklist](/images/self-code-review/image.jpg)

I will share with you the steps I take before commiting code. Probably most of them are obvious to you, but maybe you will find something interesting and worth including into your routine?

## **1. Compilation errors**

This might seem to be quite obvious. If the code doesn’t compile, how can you even check if it works? I have added this step to my in-mind checklist lately as in our TypeScript projects the `compile` script is a little more “strict” than the one for running an app in the hot reloading mode (e.g. compilation errors on unused imports). So even though the app recompiles seamlessly, it will not compile on the CI server.

## **2. Warnings**

I actually quite like a strict approach when warnings prevent compilation. But this is not always the case, so it’s worth  having in mind to look through the warnings and apply fixes where needed.

## **3. Unit and integration tests**

Just run all tests and see if they are green. This is also the time for some framework-specific checks, e.g. `mocha` requires to append `only()` to test methods to run a specific subset of the tests. Of course you need to remove it before commiting :) Do you know any other frameworks’ features which are likely to produce this kind of leftovers?

## **4. The code review itself**

I usually list all the files that have changed and then read them carefully one by one, paying special attention to the following elements (the similarity to an ordinary code review process is not accidental :) ).

* All the little things that make the code cleaner like all the shorthands or smart methods that modern languages have (to name a few: Kotlin’s `isNullOrEmpty` or Scala's `getOrElse`). IDEs give lots of such hints, we just need to make use of them.
* Spelling - typos make the code messy :)
* Rethink the names of classes, variables and so on. Are they meaningful enough? Or maybe too verbose?
* Any too complicated constructions like long computations or nested conditions? If I have just written it and still do not get the sense at first glance, maybe there is a way to make it cleaner?

IDEs make this kind of reading easier. In the code editing window you have the changed lines marked so you know which ones to focus on at most. I know some of us use the diff window for this purpose. I usually prefer the more gentle way of highlighting the differences, but that’s quite personal - try both and decide which is the best for you. Or just combine them.

## **5. The big picture**

Then I read the code again, taking the big picture this time. The aim is to check if the code is clear and understandable, if it just reads smoothly.

## **6. CI server check**

Once I have committed and pushed, the last step is to check if the code compiles and the tests are green on the CI server.

Do I apply this routine each and every time? Does this routine prevent me from checking some fishy code in? Of course not, we all know scenarios of delivering a feature as soon as possible or just a little change which surely does not require all these steps. Commits like `Fix typos` or `Remove “only” from tests` still happen :) But after all, we are only humans and we all make mistakes. And the teammate code review is just irreplaceable :)

repository: bright/new-www

branch_name: refs/heads/gatsby

repo_name: bright/new-www


text:
# md_transformer

[![Gem Version](https://badge.fury.io/rb/md_transformer.svg)](https://badge.fury.io/rb/md_transformer) [![Build Status](https://travis-ci.com/wheatevo/md_transformer.svg?branch=master)](https://travis-ci.com/wheatevo/md_transformer) [![Inline docs](http://inch-ci.org/github/wheatevo/md_transformer.svg?branch=master)](http://inch-ci.org/github/wheatevo/md_transformer)

The md_transformer gem provides a way to read, modify, and write Markdown much as a hash with header keys and markdown content values.

This code:
```ruby
require 'md_transformer'

# Create a new markdown object and manipulate it
md = MdTransformer.markdown("# md_transformer\nThe md_transformer gem...\n")
md['md_transformer']['Installation'] = "Add this line to your application's Gemfile"
md['md_transformer']['Usage'] = ''
md['md_transformer']['Usage']['Creating a Markdown object'] = 'The `MdTransformer`...'
md.write('my_new_readme.md')
```

Generates a Markdown file at `my_new_readme.md` with the following content:
```md
# md_transformer
The md_transformer gem...
## Installation
Add this line to your application's Gemfile
## Usage
### Creating a Markdown object
The `MdTransformer`...
```

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'md_transformer'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install md_transformer

## Usage

### Creating a Markdown object
The `MdTransformer` module has several helper methods for creating a new `MdTransformer::Markdown` object.

#### Create from Content
Use the `MdTransformer.markdown` method to create a new `MdTransformer::Markdown` object from a string.
```ruby
md_object = MdTransformer.markdown("# My document\nInformation is good.\n\n## More information\n> Detailed data\n")
```

> The `md` method is also available as an alias to `markdown`

#### Create from File
Use the `MdTransformer.markdown_file` method to create a new `MdTransformer::Markdown` object from a file.
```ruby
md_object = MdTransformer.markdown_file('README.md')
md_object = MdTransformer.markdown_file('/full/path/to/README.md')
```
> The `md_file` method is also available as an alias to `markdown_file`

### Manipulating the Markdown document
The `MdTransformer::Markdown` object can be used similarly to a `Hash`. Headers are treated as keys that refer to sections of the Markdown document.

#### Markdown can be Accessed as a Hash
```ruby
# Create Markdown object from a string
md1 = MdTransformer.markdown("# Title\nContent\n## Sub-heading\nSub-content\n## Sub-heading 2\nMore content\n")

# Get all heading keys for the Title heading
md1['Title'].keys
# => ["Sub-heading", "Sub-heading 2"]

# Get the content of the Title heading
md1['Title'].content
# => "Content\n"

# Get the content of the Sub-heading
md1['Title']['Sub-heading'].content
# => "Sub-content\n"

# Dig for a key
md1.dig('Title', 'Sub-heading').content
# => "Sub-content\n"

# Output a section as a string
md1['Title'].to_s
# => "# Title\nContent\n## Sub-heading\nSub-content\n## Sub-heading 2\nMore content\n"

# Update the content of a section
md1['Title']['Sub-heading'] = "Here is new content!\n"
md1['Title']['Sub-heading'].content
# => "Here is new content!"
```

#### Markdown can be Compared
```ruby
# Create Markdown objects from a string
md1 = MdTransformer.markdown("# Title\nContent\n## Sub-heading\nSub-content\n")
md2 = MdTransformer.markdown("# Title\nContent\n## Sub-heading\nSub-content 2\n")

md1 == md2
# => false

# Set the ## Sub-heading content on md2 to match md1
md2['Title']['Sub-heading'] = 'Sub-content'

md1 == md2
# => true
```

#### Markdown can be Enumerated
```ruby
# Create Markdown object from a string
md1 = MdTransformer.markdown("# Title\nContent\n## Sub-heading\nSub-content\n## Sub-heading 2\nMore content\n")

md1['Title'].map { |k, v| "#{k}!" }
# => ["Sub-heading!", "Sub-heading 2!"]
```

### Rendering the Markdown document

#### Viewing the content of the document
Use the `to_s` method to convert the `MdTransformer::Markdown` object into valid Markdown content.
```ruby
# Show the current markdown document
puts md_object

# Assign the markdown document content to a string
string_content = md_object.to_s
```

#### Writing the document to a file
Use the `write` method to write the current `MdTransformer::Markdown` object's content to a file.
```ruby
md_object.write('test.md')
md_object.write('/my/long/directory/README.md')
```

### Need More Help?
Please take a look at the [API documentation](https://www.rubydoc.info/github/wheatevo/md_transformer/master).

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/wheatevo/md_transformer.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).


text:
## Metadata Record -- Main Section
---

### Time Period Object

Time Period 1{**type**: object (Time Period)}1 The Time Period object describes a period of time over which the resource is relevant.  For project resources, the time period might represent the start and end date of activity.  For data resources, the time period may convey the date range of the resource data points.

{% include "../../../include-objects/timePeriod-obj.md" %}

repository: adiwg/mdEditor-doc

gha_language: SCSS

repo_name: adiwg/mdEditor-doc


text:
# SvgOptimizer

[![Tests](https://github.com/fnando/svg_optimizer/workflows/ruby-tests/badge.svg)](https://github.com/fnando/svg_optimizer)
[![Code Climate](https://codeclimate.com/github/fnando/svg_optimizer/badges/gpa.svg)](https://codeclimate.com/github/fnando/svg_optimizer)
[![Gem](https://img.shields.io/gem/v/svg_optimizer.svg)](https://rubygems.org/gems/svg_optimizer)
[![Gem](https://img.shields.io/gem/dt/svg_optimizer.svg)](https://rubygems.org/gems/svg_optimizer)

Some small optimizations for SVG files.

## Installation

```bash
gem install svg_optimizer
```

Or add the following line to your project's Gemfile:

```ruby
gem "svg_optimizer"
```

## Usage

```ruby
# Optimize an existing String.
xml = File.read("file.svg")
optimized = SvgOptimizer.optimize(xml)

# Optimize a file - it will override the original file.
SvgOptimizer.optimize_file("file.svg")

# Optimize a file - it saves a copy to "optimized/file.svg".
SvgOptimizer.optimize_file("file.svg", "optimized/file.svg")
```

You can specify the plugins you want to enable. The method signature is:

```ruby
SvgOptimizer.optimize(xml, plugins)
SvgOptimizer.optimize_file(input, output, plugins)
```

where `plugins` is an array of classes that implement the following contract:

```ruby
class MyPlugin < SvgOptimizer::Plugins::Base
  def process
    xml.xpath("//comment()").remove
  end
end
```

The default list of plugins is stored at `SvgOptimizer::DEFAULT_PLUGINS`. To use
your new plugin, just do something like this:

```ruby
SvgOptimizer.optimize(xml, SvgOptimizer::DEFAULT_PLUGINS + [MyPlugin])
```

## Maintainer

- [Nando Vieira](https://github.com/fnando)

## Contributors

- https://github.com/fnando/svg_optimizer/contributors

## Contributing

For more details about how to contribute, please read
https://github.com/fnando/svg_optimizer/blob/main/CONTRIBUTING.md.

## License

The gem is available as open source under the terms of the
[MIT License](https://opensource.org/licenses/MIT). A copy of the license can be
found at https://github.com/fnando/svg_optimizer/blob/main/LICENSE.md.

## Code of Conduct

Everyone interacting in the svg_optimizer project's codebases, issue trackers,
chat rooms and mailing lists is expected to follow the
[code of conduct](https://github.com/fnando/svg_optimizer/blob/main/CODE_OF_CONDUCT.md).


text:
Congratulations! You now have an SDM that
will enable you to create Spring Boot projects
that will automatically benefit from CD.

## Prerequisites
Please ensure you have a JDK and Maven installed on your system.

## Starting your SDM
Go to your new directory and start your SDM in local mode by typing

```bash
atomist start --local
```

## Functionality

You will now be able to create new Spring projects by typing `atomist create spring`

Follow the output in the Atomist lifecycle console for links as they are deployed

repository: atomist/sdm-local

repo_name: atomist/sdm-local


text:
---
layout: pages
route: /archive/2013/buying-and-updating-my-new-surface-rt.html
alternateRoutes: [/2013/12/buying-and-updating-my-new-surface-rt.html]
title: Buying and Updating My New Surface RT Tablet
tags:
 - opinion
category: archive
---

This has been a great year for me for getting new or updated electronic devices.  When I saw the Black Friday special for the $199 Surface RT 32GB, I decided it was time to buy.

Black Friday Online Madness

I started trying to order at 11 PM my time, when the special started.  3 hours later and a wonderful hint on Twitter that the mobile site wasn't having the same issues, and I had my order placed.   The 3 hours was spent trying to order via the web site.  It only took me 2 minutes to order on the mobile site.

I found Microsoft's mobile store to be very nice and easy to use.  I was accessing it from a Windows Phone but I would assume it would work just as well from another smart phone.

Fast-forward one week and my surface arrived in its shiny black and white box.  I was a little disappointed when I opened it to find the packing material completely flat, allowing it to move around some but so far I haven't noticed any ill effects from that.

I opened the box and immediately tried to power on the device but nothing happened.  I plugged it in and tried again and everything works.  Apparently it (or at least mine) arrives with no battery charge.

0x800b0101 means your clock is wrong in Microsoft language

I tried to go through setup and add my Microsoft account but I got the very cryptic "0x800b0101" error.  Thanks to this blog post, I decided to try setting the clock.  To do that, swipe in from the right, type the word "date" (or "time") in the search box and hit the search button.  Tap "Settings" below the search and you should see a "Set the time and date" in the middle of the screen.  Click on that and change the time and time zone to your current time and time zone.

That worked and after that change I could update to my Microsoft account.

Why the clock did not automatically update, I do not know.  Windows 8 is configured by default to update its time from an internet time source, and I did have a good connection to the internet at this point.  (For those of you interested in a technical explanation, my colleague is probably right when he ways "I'm guessing your time thing is related to how long your Surface sat in the box and this.")

I wanted to make sure that I had all of the updates available for my new Surface.  You could choose to be patient and wait for the updates to happen on their own, but I want everything to be updated.

Windows Updates

App updates should come from the Store app and should appear when you open that app.   Windows updates can be access by swiping in from the right, click "Settings", and then click "Change PC Settings".  Windows Update is the bottom item on the list.  By default it is set to automatically check for updates but I'm in a hurry so I click on the "Check for Updates" button.  It looks for a bit and then tells me that there is a firmware update and that there are 37 updates.

Remember the part earlier where the battery isn't charged.  I still have it plugged in but Windows Update wants more.  The message that comes back is "Plug your PC into power, let it fully recharge, and try again."

I checked back in 1 hour and it had apparently decided that I had enough battery power and gone ahead with the updates.  At that point there was a message telling me that my computer would reboot in 1 day to complete the updates.  I selected the option to restart immediately and finish updates.  Now it tells me to keep the PC plugged in until this is done and it is installing updates.

This takes a very long time.  I started the process at 10:00 AM it saying "Installing 1 of 15".  An hour later, it says "Installing 2 of 15".  At 12:30 it says "Installing update 14 of 15", so now we're making some progress.

I ran some errands and checked again at 3:30 PM.  Finally, it was all done with the updates.

Windows 8.1 Upgrade

At this point I logged in and went to the Store app, where I found the Windows 8.1 upgrade waiting for me.  I skipped the other app updates that it showed and I start the download on that (2.1 gigabytes) and it is time to take another break waiting for the download to complete.  2 hours later (5:30 PM) and it appears to be done with the download portion and the first part of the install, as it says "Preparing to restart".  A few minutes later it is saying that it is going to restart and that I should save any work.  I select "Restart now" and wait some more.

Another 45 minutes (6:15 PM) and it finishes the update and asks me to accept the license agreement.  I believe it said that if you don't accept it, it will undo the Windows 8.1 update, so make sure you click the right button at this step.

I opened up the store app and apparently, updating to Windows 8.1 also updated all of the apps, so everything is ready to go.

The "0x800b0101" error was very frustrating.  I found the answer in a short time because of my experience but I couldn't imagine a regular joe finding the answer that quickly.  It seems like there should be an error message indicating that the issue is with the date and time on the Surface.  Also, there should be something in the setup that forces a time update from the internet, once the internet connection is available.

It took a long time to get through all of the updates.  I started opening the box at 9:00 AM and was finished with all of the updating by 6:15 PM.  The time is reasonable when you consider that this device is a year old and these are all of the updates for that year.  Future updates should not take nearly as long.

I am very happy with my new Surface RT.  I like that it comes with Office 2013 RT, including Outlook 2013.  I hope that everyone that gets one this Christmas enjoys it as much as I do.