text:
---
title: 'Assemble a composite component'
tocTitle: 'Composite component'
description: 'Assemble a composite component out of simpler components'
---

Last chapter we built our first component; this chapter extends what we learned to build TaskList, a list of Tasks. Let’s combine components together and see what happens when more complexity is introduced.

## Tasklist

Taskbox emphasizes pinned tasks by positioning them above default tasks. This yields two variations of `TaskList` you need to create stories for: default items and default and pinned items.

![default and pinned tasks](/intro-to-storybook/tasklist-states-1.png)

Since `Task` data can be sent asynchronously, we **also** need a loading state to render in the absence of a connection. In addition, an empty state is required when there are no tasks.

![empty and loading tasks](/intro-to-storybook/tasklist-states-2.png)

## Get setup

A composite component isn’t much different than the basic components it contains. Create a `TaskList` component and an accompanying story file: `components/TaskList.js` and `components/TaskList.stories.js`.

Start with a rough implementation of the `TaskList`. You’ll need to import the `Task` component from earlier and pass in the attributes and actions as inputs.

```javascript
// components/TaskList.js
import * as React from 'react';
import Task from './Task';
import { FlatList, Text, SafeAreaView } from 'react-native';
import { styles } from '../constants/globalStyles';

function TaskList({ loading, tasks, onPinTask, onArchiveTask }) {
  const events = {
    onPinTask,
    onArchiveTask,
  };
  if (loading) {
    return (
      <SafeAreaView style={styles.ListItems}>
        <Text>loading</Text>
      </SafeAreaView>
    );
  }
  if (tasks.length === 0) {
    return (
      <SafeAreaView style={styles.ListItems}>
        <Text>empty</Text>
      </SafeAreaView>
    );
  }
  return (
    <SafeAreaView style={styles.ListItems}>
      <FlatList
        data={tasks}
        keyExtractor={task => task.id}
        renderItem={({ item }) => <Task key={item.id} task={item} {...events} />}
      />
    </SafeAreaView>
  );
}

export default TaskList;
```

Next create `Tasklist`’s test states in the story file.

```javascript
// components/TaskList.stories.js
import * as React from 'react';
import { View } from 'react-native';
import { styles } from '../constants/globalStyles';
import { storiesOf } from '@storybook/react-native';
import { task, actions } from './Task.stories';
import TaskList from './TaskList';

export const defaultTasks = [
  { ...task, id: '1', title: 'Task 1' },
  { ...task, id: '2', title: 'Task 2' },
  { ...task, id: '3', title: 'Task 3' },
  { ...task, id: '4', title: 'Task 4' },
  { ...task, id: '5', title: 'Task 5' },
  { ...task, id: '6', title: 'Task 6' },
];
export const withPinnedTasks = [
  ...defaultTasks.slice(0, 5),
  { id: '6', title: 'Task 6 (pinned)', state: 'TASK_PINNED' },
];

storiesOf('TaskList', module)
  .addDecorator(story => <View style={[styles.TaskBox, { padding: 42 }]}>{story()}</View>)
  .add('default', () => <TaskList tasks={defaultTasks} {...actions} />)
  .add('withPinnedTasks', () => <TaskList tasks={withPinnedTasks} {...actions} />)
  .add('loading', () => <TaskList loading tasks={[]} {...actions} />)
  .add('empty', () => <TaskList tasks={[]} {...actions} />);
```

As you may have noticed, the `addDecorator()` was used in the previous chapter and in this one, it allows us to add some “context” to the rendering of each task. In this case we add padding around the list to make it easier to visually verify.

Decorators are a way to provide arbitrary wrappers to stories. In this case we’re using a decorator to add styling. They can also be used to wrap stories in “providers” –i.e. library components that set React context.

`task` supplies the shape of a `Task` that we created and exported from the `Task.stories.js` file. Similarly, `actions` defines the actions (mocked callbacks) that a `Task` component expects, which the `TaskList` also needs.

Don't forget that this story also needs to be added to `storybook/index.js` so that it can be picked up and displayed.

Change the `configure()` method to the following:

```javascript
// storybook/config.js
configure(() => {
  require('../components/Task.stories.js');
  require('../components/TaskList.stories.js');
}, module);
```

Now check Storybook for the new `TaskList` stories.

<video autoPlay muted playsInline loop>
  <source
    src="/intro-to-storybook/inprogress-tasklist-states.mp4"
    type="video/mp4"
  />
</video>

## Build out the states

Our component is still rough but now we have an idea of the stories to work toward. You might be thinking that the `listitems` wrapper is overly simplistic. You're right – in most cases we wouldn’t create a new component just to add a wrapper. But the **real complexity** of `TaskList` component is revealed in the edge cases `withPinnedTasks`, `loading`, and `empty`.

For the loading edge case, we're going to create a new component that will display the correct markup.

Create a new file called `LoadingRow.js` with the following content:

```javascript
// components/LoadingRow.js
import React, { useState, useEffect } from 'react';
import { Animated, Text, View, Easing, SafeAreaView } from 'react-native';
import { styles } from '../constants/globalStyles';

const GlowView = props => {
  const [glowAnim] = useState(new Animated.Value(0));

  useEffect(() => {
    Animated.loop(
      Animated.timing(glowAnim, {
        toValue: 1,
        duration: 1500,
        easing: Easing.inOut(Easing.quad),
      })
    ).start();
  }, []);
  return (
    <Animated.View
      style={{
        ...props.style,
        opacity: glowAnim,
      }}
    >
      {props.children}
    </Animated.View>
  );
};

const LoadingRow = () => (
  <SafeAreaView style={{ padding: 12 }}>
    <GlowView>
      <View style={styles.LoadingItem}>
        <View style={styles.GlowCheckbox} />
        <Text style={styles.GlowText}>Loading</Text>
        <Text style={styles.GlowText}>cool</Text>
        <Text style={styles.GlowText}>state</Text>
      </View>
    </GlowView>
  </SafeAreaView>
);

export default LoadingRow;
```

And update `TaskList.js` to the following:

```javascript
// components/TaskList.js
import * as React from 'react';
import Task from './Task';
import PercolateIcons from '../constants/Percolate';
import LoadingRow from './LoadingRow';
import { FlatList, Text, SafeAreaView, View } from 'react-native';
import { styles } from '../constants/globalStyles';

function TaskList({ loading, tasks, onPinTask, onArchiveTask }) {
  const events = {
    onPinTask,
    onArchiveTask,
  };

  if (loading) {
    return (
      <SafeAreaView style={styles.ListItems}>
        <LoadingRow />
        <LoadingRow />
        <LoadingRow />
        <LoadingRow />
        <LoadingRow />
        <LoadingRow />
      </SafeAreaView>
    );
  }
  if (tasks.length === 0) {
    return (
      <SafeAreaView style={styles.ListItems}>
        <View style={styles.WrapperMessage}>
          <PercolateIcons name="check" size={64} color={'#2cc5d2'} />
          <Text style={styles.TitleMessage}>You have no tasks</Text>
          <Text style={styles.SubtitleMessage}>Sit back and relax</Text>
        </View>
      </SafeAreaView>
    );
  }
  const tasksInOrder = [
    ...tasks.filter(t => t.state === 'TASK_PINNED'),
    ...tasks.filter(t => t.state !== 'TASK_PINNED'),
  ];
  return (
    <SafeAreaView style={styles.ListItems}>
      <FlatList
        data={tasksInOrder}
        keyExtractor={task => task.id}
        renderItem={({ item }) => <Task key={item.id} task={item} {...events} />}
      />
    </SafeAreaView>
  );
}

export default TaskList;
```

The added markup results in the following UI:

<video autoPlay muted playsInline loop>
  <source
    src="/intro-to-storybook/finished-tasklist-states.mp4"
    type="video/mp4"
  />
</video>

Note the position of the pinned item in the list. We want the pinned item to render at the top of the list to make it a priority for our users.

## Data requirements and props

As the component grows, so too do input requirements. Define the prop requirements of `TaskList`. Because `Task` is a child component, make sure to provide data in the right shape to render it. To save time and headache, reuse the propTypes you defined in `Task` earlier.

```javascript

// components/TaskList.js
import * as React from 'react';
import PropTypes from 'prop-types';

import Task from './Task';

function TaskList() {
  ...
}

TaskList.propTypes = {
  loading: PropTypes.bool,
  tasks: PropTypes.arrayOf(Task.propTypes.task).isRequired,
  onPinTask: PropTypes.func.isRequired,
  onArchiveTask: PropTypes.func.isRequired,
};

TaskList.defaultProps = {
  loading: false,
};

export default TaskList;
```

## Automated testing

In the previous chapter we learned how to snapshot test stories using Storyshots. With `Task` there wasn’t a lot of complexity to test beyond that it renders OK. Since `TaskList` adds another layer of complexity we want to verify that certain inputs produce certain outputs in a way amenable to automatic testing. To do this we’ll create unit tests using [Jest](https://facebook.github.io/jest/).

![Jest logo](/intro-to-storybook/logo-jest.png)

### Unit tests with Jest

Storybook stories paired with manual visual tests and snapshot tests (see above) go a long way to avoiding UI bugs. If stories cover a wide variety of component use cases, and we use tools that ensure a human checks any change to the story, errors are much less likely.

However, sometimes the devil is in the details. A test framework that is explicit about those details is needed. Which brings us to unit tests.

In our case, we want our `TaskList` to render any pinned tasks **before** unpinned tasks that it has passed in the `tasks` prop. Although we have a story (`withPinnedTasks`) to test this exact scenario, it can be ambiguous to a human reviewer that if the component **stops** ordering the tasks like this, it is a bug. It certainly won’t scream **“Wrong!”** to the casual eye.

So, to avoid this problem, we can use Jest to render the story to the DOM and run some DOM querying code to verify salient features of the output.

Create a test file called `components/__tests__/TaskList.test.js`. Here, we’ll build out our tests that make assertions about the output.

```javascript
// components/__tests__/TaskList.test.js
import * as React from 'react';
import { create } from 'react-test-renderer';
import TaskList from '../TaskList';
import { withPinnedTasks } from '../TaskList.stories';
import Task from '../Task';
describe('TaskList', () => {
  it('renders pinned tasks at the start of the list', () => {
    const events = { onPinTask: jest.fn(), onArchiveTask: jest.fn() };
    const tree = create(<TaskList tasks={withPinnedTasks} {...events} />);
    const rootElement = tree.root;
    const listofTasks = rootElement.findAllByType(Task);
    expect(listofTasks[0].props.task.title).toBe('Task 6 (pinned)');
  });
});
```

![TaskList test runner](/intro-to-storybook/tasklist-testrunner.png)

Note that we’ve been able to reuse the `withPinnedTasks` list of tasks in both story and unit test; in this way we can continue to leverage an existing resource (the examples that represent interesting configurations of a component) in many ways.

Notice as well that this test is quite brittle. It's possible that as the project matures, and the exact implementation of the `Task` changes --perhaps using a different styling prop or a `Text` rather than an `TextInput`--the test will fail, and need to be updated. This is not necessarily a problem, but rather an indication to be careful about liberally using unit tests for UI. They're not easy to maintain. Instead rely on visual, snapshot tests where possible.


text:
# DesignSystem - BOT

DesignSystem is a free and open-source solution to your server managing problems, built from scratch with code organization and quality in mind. Our goal is to cover as many functionalities and niches as possible, while still maintaining high quality.

It has features like opening GitHub-Profiles, GitHub-Pages and much more. The following table provided below has all the contents listed for the documentation.

## List of Topics

- [Overview](#overview)
- [Features](#features)
- [Commands](#commands)
- [Setup](#setup)
- [Contributing](#contributing)
- [Sponsors](#sponsors)
- [Open Source Events](#open-source-events)
- [Other useful links and resources](#other-useful-links-and-resources)

## Overview

<img src="designsystem-gif-profile.gif"
style="width: 50%;">

## Features

## Commands

- Github Related Commands

    |Command                                  | Description |
    |-----------------------------------------|-------------|
    |```-ds <username>```                     | To get your github profile link|
    |```-ds <username> <repository_name>```   | To get link to your repository on github|

- Documentation Related Commands

    |Command                                  | Description |
    |-----------------------------------------|-------------|
    |```-ds docs / -ds documentation```       | To get documentation for designsystem-bot|

- General Commands

    |Command                                  | Description |
    |-----------------------------------------|-------------|
    |```-ds help```                           | To see the helping cheat sheet|
    |```-ds motivate / -ds quote```           | To get random motivational messages |
    |```-ds greet```                          | To get random greetings according to the time (Currently not working)|
    |```-ds portfolio: FirstName, LastName, PortfolioLink```    | To create a new entry for your portfolio|
    |```-ds portfolio```    | To share your portfolio saved in the bot|

## Setup
### [Click here to integrate this bot to your server](https://discord.com/api/oauth2/authorize?client_id=789135107486777354&permissions=0&scope=bot)

## Contributing

For new open source developers and for those who are new here can get started by referring [```CONTRIBUTING.md```](https://github.com/yashsehgal/designsystem-bot/blob/master/CONTRIBUTING.md)
## Sponsors

## Open Source Events

![ds-loves-open-source](https://raw.githubusercontent.com/yashsehgal/designsystem-bot/master/love-open-source%402x.png)

## Other Useful links and resources

repository: yashsehgal/designsystem-bot

branch_name: refs/heads/master

extension: md

gha_language: Python

license_type: permissive

repo_name: yashsehgal/designsystem-bot


text:
# MCCI's version of Adafruit I2C FRAM Driver

This driver is adapted from Adafruit's driver for the
Adafruit I2C FRAM breakout. https://www.adafruit.com/products/1895

MCCI fixed bugs, and added support for 2K FRAM modules.

## About this Driver

These modules use I2C to communicate, 2 pins are required to
interface

Adafruit and MCCI invest time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit and MCCI!

Written by Kevin (KTOWN) Townsend for Adafruit Industries.
BSD license, check license.txt for more information
All text above must be included in any redistribution

To download, click the ZIP button in the top bar, and check this tutorial
for instructions on how to install:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use

## Compatibility

MCU                | Tested Works | Doesn't Work | Not Tested  | Notes
------------------ | :----------: | :----------: | :---------: | -----
ATSAM21D           |      X       |              |             | Adafruit Feather M0 + MCCI 4450, 4460, etc. Feather Wings
STM32L0            |      X       |              |             | Murata Murata CMWX1ZZABZ-078 on [MCCI Catena 4610](https://mcci.io/catena4610), [4612](https://mcci.io/catena4612), [4801](https://mcci.io/catena4801), etc.

gha_license_id: NOASSERTION


text:
## [Features](#features)

|  name | description | example
|-------|-------------|---------
| [behavior](/features/behavior) | Define cross-cutting behaviors that are applied to many HTML elements
| [def](/features/def) | Defines a function | [see details...](/features/def)
| [eventsource](/features/event-source) | Subscribe to Server Sent Events (SSE)
| [js](/features/js) | Embed JavaScript code at the top level | [see details...](/features/js)
| [init](/features/init) | Initialization logic to be run when the code is first loaded
| [on](/features/on) | Creates an event listener | `on click log "clicked!"`
| [socket](/features/socket) | Create a Web Socket
| [worker](/features/worker) | Create a Web Worker for asynchrnous work

## [Commands](#commands)

{% include commands_table.md %}

## [Expressions](#expressions)

See [expressions](/expressions) for an overview.

|  name | description | example
|-------|-------------|---------
| [as expressions](/expressions/as) | Converts an expression to a new value | `"10" as Int`
| [async expressions](/expressions/async) | Evaluate an expression asynchronously | `set x to async getPromise()`
| [attribute reference](/expressions/attribute-ref) | An attribute reference | `[selected=true]`
| [block literal](/expressions/block-literal) | Anonymous functions with an expression body | `\ x -> x * x`
| [class reference](/expressions/class-reference) | A class reference | `.active`
| [comparison operator](/expressions/comparison-operator) | Comparison operators | `x == "foo" I match <:active/>`
| [id reference](/expressions/id-reference) | An id reference | `#main-div`
| [logical operator](/expressions/logical-operator) | Logical operators | `x and y`
`z or false`
| [no operator](/expressions/no) | No operator | `no element.children`
| [query reference](/expressions/query-reference) | A query reference | `<button/> <:focused/>`
| [time expression](/expressions/time) | A time expression | `200ms`
| [closest expression](/expressions/closest) | Find closest element | `closest <div/>`
| [of expression](/expressions/of) | Get a property of an object | `the location of window`
| [positional expressions](/expressions/positional) | Get a positional value out of an array-like object | `first from <div/>`
| [possessive expressions](/expressions/possessive) | Get a property or attribute from an element | `the window's location`
| [relative positional expressions](/expressions/relative-positional) | Get a positional value out of an array-like object | `first from <div/>`

##  [Magic Values](#magic-values)

|  name | description | example
|-------|-------------|---------
| [it](/expressions/it) | The result of a previous command | `fetch /people as JSON then put it into people`
| [me](/expressions/me) | Reference to the current element | `put 'clicked' into me`
| [you](/expressions/you) | Reference to a target element | `tell <p/> remove yourself`

##  [Literals](#literals)

Define other values just like you do in Javascript

|  name | description | example
|-------|-------------|---------
| arrays | Javascript-style array literals | `[1, 2, 3]`
| booleans | Javascript-style booleans | `true false`
| math operators | Javascript-style mathematical operators | `1 + 2`
| null | Javascript-style null | `null`
| numbers | Javascript-style numbers | `1  3.14`
| objects | Javascript-style object literals | `{foo:"bar", doh:42}`
| [strings](/expressions/string) | Javascript-style strings | `"a string", 'another string'`


text:
Dexter Dashboard

    Built for EthOnline 2021.

  About The Project •
  Stack •
  Creating Blocks •
  Credits

## About The Project
Dexter is a DeFi dashboard that allows you to create, import and export dashboard layouts to share with your friends. The dashboard aims to combine the customizability of Notion with the detailed data insights of Bloomberg terminal. Users have the ability to open a pull request to easily add their own blocks to the repository. Please see below for more information on creating your own block.

![screenshot]("./../packages/frontend/public/images/DexterSubmission.jpeg)

## Stack

Name                          |  Usage
----------------------------------|------------------------------------------------------------------------------------
Alchemy            |  Primary Web3 API for fetching token metadata and balances.
The Graph            |  Provides on chain data for analytics and NFT source information.
Protocol Labs            |  NFT.Storage is used to upload images to IPFS and provide a ipfs url for NFT creation.
ENS                |  Reverse and forward ENS resolution on the wallet provides readable address information.
Zora                 |  Auction images are displayed on the NFT block
Scaffold Eth          |  The Next.js and Typescript template provided a great starter for this project.
Chakra UI                 |  For style

## Creating Blocks
- Step 1: Create your new block folder in the `/blocks` folder.

```
src
└── blocks
    └── YourAwesomeBlock.tsx
```
- Step 2: Write your component and wrap it in the `<CustomBlock/>` component.
```typescript
import React from 'react'
import { CustomBox } from '@components/CustomBox'
import {Text} from '@chakra-ui/layout'

export const AwesomeBlock = () => {
  return (
    <CustomBlock>
      <Text>My awesome DeFi block for Dexter</Text>
    </CustomBlock>
  )
}
```
- Step 3: Add the custom block to the `/BlockData` folder.
```
src
└── constants
    └── BlockData
```

In the `BlockData` array, add your component.
```typescript
const BlockData = [
  ...OtherData,
  { index: '12', title: 'AwesomeBlock', protocol: 'Ethereum' },
]
```

In the `getBlockType` function, add your component to the switch statement.
```typescript
export const getBlockType = (block: BlockType, provided): JSX.Element => {
  switch (block.title) {
    case "AwesomeBlock":
      return <AwesomeBlock/>
  }
```

- Done 🎉

## Credits
- Created by Jack Burrus

[![GitHub Badge](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/jackburrus)
[![Twitter Badge](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/jackburrus)
[![LinkedIn Badge](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/jamesburrus/)

license: MIT

repository: jackburrus/dexterfinance

branch_name: refs/heads/main

repo_name: jackburrus/dexterfinance


text:
---
title: 'Styling and CSS'
---

There are many ways to include CSS in a web application, and correspondingly there are many ways to include CSS in Storybook. Usually, it is best to try and replicate what your application does with styling in Storybook’s configuration. To make this easier, we recommend using [`@storybook/addon-styling`](https://github.com/storybookjs/addon-styling).

## Importing CSS files

Storybook is pre-configured to recognize imports for CSS files. To add global CSS for all your stories, import it in [`.storybook/preview.js`](./overview.md#configure-story-rendering).

<!-- prettier-ignore-start -->

<CodeSnippets
  paths={[
    'common/storybook-preview-import-global-styles.js.mdx',
    'common/storybook-preview-import-global-styles.ts.mdx',
  ]}
/>

<!-- prettier-ignore-end -->

If your component files import their CSS files, this will work too. The noticeable exception to this is if you're using CSS processor tools like Sass or Postcss.

## CSS processors

If you're using Vite as your builder, you're covered! Vite supports Sass and PostCSS out-of-the-box 🎉

However, if you're using Webpack and want to use Sass and PostCss, you'll need some extra configuration. We recommend installing [`@storybook/addon-styling`](https://github.com/storybookjs/addon-styling#storybookaddon-styling) to help you configure these tools. Or if you'd prefer, you can customize [Storybook's webpack configuration yourself](../builders/webpack.md#override-the-default-configuration) to include the appropriate loader(s).

## CSS-in-JS

CSS-in-JS libraries are designed to use basic JavaScript, and they often work in Storybook without any extra configuration. Some libraries expect components to render in a specific rendering “context” (for example, to provide themes), which can be accomplished with `@storybook/addon-styling`'s [`withThemeFromJSXProvider` decorator](https://github.com/storybookjs/addon-styling/blob/next/docs/api.md#withthemefromjsxprovider).

## Adding webfonts

If you need webfonts to be available, you may need to add some code to the [`.storybook/preview-head.html`](./story-rendering.md#adding-to-head) file. We recommend including any assets with your Storybook if possible, in which case you likely want to configure the [static file location](./images-and-assets.md#serving-static-files-via-storybook-configuration).

## Troubleshooting

### Styles aren't being applied with Angular

The latest Angular releases introduced significant changes in configuring and styling projects. If you're working with an Angular version greater than 13 and your styles aren't being applied, you may need to check your `angular.json` ad adjust the `builder` configuration to import your CSS:

```json
{
  "my-project": {
    "architect": {
      "build": {
        "builder": "@angular-devkit/build-angular:browser",
        "options": {
          "styles": ["src/styles.css", "src/styles.scss"]
        }
      }
    }
  }
}
```

Additionally, if you need Storybook-specific styles that are separate from your application, you can configure the styles with [Storybook's custom builder](../get-started/install.md), which will override the application's styles:

```json
{
  "storybook": {
    "builder": "@storybook/angular:start-storybook",
    "options": {
      "browserTarget": "my-default-project:build",
      "styles": [".storybook/custom-styles.scss"]
    }
  }
}
```

### NX component libraries not loading styles

If you're working with Storybook and [Nx libraries](https://nx.dev/structure/library-types),
you can extend your project's configuration (i.e., `project.json`) and provide the application's styles.

For earlier Nx versions (before `14.1.8`), your configuration would look like this:

```json
 "build-storybook": {
    "executor": "@nrwl/storybook:build",
    "outputs": ["{options.outputPath}"],
    "options": {
      "uiFramework": "@storybook/angular",
      "outputPath": "dist/storybook/example-lib",
      "config": {
        "configFolder": "libs/example-lib/storybook/.storybook"
      },
      "projectBuildConfig": "example-lib:build-storybook",
      "styles": ["apps/example-app/src/styles.scss"]
    }
  }
```

Starting with version `14.1.8`, Nx uses the Storybook builder directly, which means any configuration supplied to the builder also applies to the NX setup. If you're working with a library, you'll need to configure the styling options ( e.g., preprocessors) inside the `build-storybook` `options` configuration object. For example:

```json
    "storybook": {
      "executor": "@storybook/angular:start-storybook",
      "options": {
        "configDir": "apps/example-lib/.storybook",
        "browserTarget": "example-lib:build-storybook",
      },
    },
    "build-storybook": {
      "executor": "@storybook/angular:build-storybook",
      "outputs": ["{options.outputPath}"],
      "options": {
        "outputDir": "dist/storybook/example-lib",
        "configDir": "apps/example-lib/.storybook",
        "browserTarget": "example-lib:build-storybook",
        "styles": [".storybook/custom-styles.scss"],
        "stylePreprocessorOptions": {
          "includePaths": [
            "libs/design-system/src/lib"
          ]
        }
      }
    }
```

When Nx runs, it will load Storybook's configuration and styling based on [`storybook`'s `browserTarget`](https://nx.dev/storybook/extra-topics-for-angular-projects#setting-up-browsertarget).

repository: storybookjs/storybook

branch_name: refs/heads/next

gha_language: TypeScript

gha_license_id: MIT

repo_name: storybookjs/storybook


text:
# JupyterLab extension that allows to use AI Platform Notebooks with personal credentials

In short, it works like this:

![](./example.gif)

## Installation

This extension includes both a notebook server extension and a lab extension. In order to use it, you must enable both of them.

To install the server extension, run the following in your terminal:

```bash
pip3 install jupyterlab-gcloud-auth
```

To install the lab extension, run:

```bash
jupyter labextension install jupyterlab-gcloud-auth
```

Don't forget to restart jupyter:

```bash
sudo service jupyter restart
```

and refresh the browser tab.

## Installation For Development (Remote From Local Machine)

```bash
# INSTANCE_NAME - name of either AI Platform Notebook instance or Cloud AI Deep Learning VM
git clone https://github.com/gclouduniverse/jupyterlab-gcloud-auth.git
cd jupyterlab-gcloud-auth
./deploy.sh INSTANCE_NAME
```

repository: gclouduniverse/jupyterlab-gcloud-auth

repo_name: gclouduniverse/jupyterlab-gcloud-auth


text:
# Force HTTPS in WordPress

Your WordPress app running on Nanobox sits behind a load balancer that forwards requests to your web server. Because of this, you must use the `X-Forwarded-Proto` HTTP header to detect the requests origin protocol and redirect appropriately. All redirects are handled in your `.htaccess`. Below is an example of what the redirect using the `X-Forwarded-Proto` header would look like.

#### Forcing HTTPS in the .htaccess
```apacheconf
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^(.*)https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
```

## Forcing HTTPS Only on Live Servers
When running WordPress locally in development or in a dry-run environment, forcing HTTPS will result in an error since there is no certificate on your local DNS. To get around this, you can use a "config swap" to switch out your .htaccess when deploying to a live app.

### Create Two .htaccess files
For the config swap to happen, you need to have two versions of your `.htaccess` file - one with the HTTPS rewrite and one without. Create a `nanobox` subdirectory in the root of your project, add add the `live.htaccess` with the HTTPS rewrite there. Leave the `.htaccess` in the root of your project as is.

#### nanobox/live.htaccess
```apacheconf
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# Force https
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^(.*)https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END WordPress
```

#### .htaccess
```apacheconf
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
```

**Note:** With two .htaccess files, any modifications made by plugins or directly will need to be manually applied to `nanobox/live.htaccess`.

## Swap the .htaccess Files on Deploy
`transform` hooks in your `boxfile.yml` allow you to modify your codebase during the deploy process. Using the `APP_NAME` environment variable that gets created with every app, you can initiate a file swap:

```yaml
deploy.config:
  transform:
    - 'if [ $APP_NAME == "yourappname" ]; then mv /app/nanobox/live.htaccess /app/.htaccess; fi'
```

*Be sure to replace* `yourappname` *with your app's actual name.*

With this in place, HTTPS will only be enforced in your live app.

repository: nanobox-io/nanobox-guides

gha_language: Pug

repo_name: nanobox-io/nanobox-guides


text:
# BookRental
BookRental is one of my first **Java EE** projects based on **JSF/JPA/JDB**. It is a web application with database that allows managing book rentals from the perspective of user, worker and administrator. Thinking back over, some parts could have been written better (like model logic). However, it was a good learning experience. Detailed overview can be found on [the project page](https://t3r1jj.github.io/BookRental "BookRental project page").

## Installation
To install BookRental:

1. Create JDB (Java DB) with default settings (*jdbc:derby://localhost:1527/library*):
  + db name: *library*,
  + username: *app*,
  + password: *app*.
  See glassfish-resources.xml for more details.
2. Deploy on server (preferably GlassFish Application Server 3.1 or newer).

## Gallery [[more]](https://t3r1jj.github.io/BookRental "BookRental project page")

Main page

## License
Copyright 2016 Damian Terlecki

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


text:
# LBLight
Light/Simple load balancer

## Summary

LBLight is a simple Layer 7 load balancer, without a lot of bells and whistles. The primary aim is to be able to route traffic based on either the beginning of the HTTP path or based on HTTP headers. It can be configured so (for example) any queries starting with "/foo" will get directed to backends X or Y... whereas any queries starting with "/bar" will be directed to backend Z. Similarly queries with a HTTP header of "X-Node" of value "A" might get redirected to backend XX and those with a value of "B" could go the backend YY.

A primary aim of this is to be able to run as an Azure App Service. The default external Azure load balancers cannot route based on path nor header. Other Azure load balancing options (Application Gateway) do exactly what we want, but appear to get a bit pricey once we hit a certain limit. This is an attempt to give basic load balancing/routing while being hosted in App Services. This can of course be hosted elsewhere, but App Services is the current target/purpose.

A few concepts are important to know before attempting to configure. There are 3 key structures/terms within LBLight.

**BackendRouter** : This is configured to handle a set of paths (/foo, /bar, /whatever) or a set of HTTP headers (key/value pairs). Each BackendRouter has a number of Backends associated with it.

**Backend**: Is a structure tied to a specific destination host (whether a VM, cluster, another LB etc). This will be used by the BackendRouter to deliver the right traffic to the right target host. eg. The BackendRouter might be configured to know any traffic starting with "/foo" needs to go to IPs <IP_ADDRESS> and <IP_ADDRESS>. For this The BackendRouter will have two Backends configured, one for each IP address. Each connection between a Backend and the destination host will have a BackendConnection instance stored within the Backend.

**BackendConnection**: Retains the actual connection between LBLight and the destination/target host. In reality this is a very small struct that primarily has a Go httputil.ReverseProxy instance which shuffles traffic between the LBLight client and the destination host. Each one of these will be running in it's own go routine.

## Building

no fancy makefiles etc... a simple "go build ." will do the trick.

## Config

Configuration of LBLight is through the lblight.json file. The format I hope is self explanatory, but if not, the key parts are:

- There is a list of BackendRouterConfigs.
- Each BackendRouterConfig has:
  - A list of AcceptedPaths (eg. /foo, /bar etc).
  - A list of AcceptedHeaders (key/value pairs for HTTP headers)
  - A list of BackendConfigs. Each of which contains the host, port and maximum number of connections allowed for each destination host.

Given LBLight needs to serve encrypted (HTTPS, WSS) traffic it will require certificates. Currently development is purely using self signed signatures (created with OpenSSL). Am not providing certificates, but are easy enough to create (google it :) )

## Running

Running locally, simple run the command with lblight.json in the same directory.

Running in App Service, the KEY piece of knowledge is that App services already live behind a TLS Terminating load balancer. This means that by the time the traffic gets to LBLight, we're not dealing with encrypted traffic anymore. This means that (from a Go pov) we need to be listening with http.ListenAndServe and NOT http.ListenAndServeTLS. Otherwise it will complain about receiving HTTP traffic on a HTTPS port. To control this, modify the lblight.json so "TlsListener" is false.

Deploy this how you would any other Go App Service, either drag and drop via SCM interface or using a tool similar to [WebjobDeploy](https://github.com/kpfaulkner/webjobdeploy etc. The files required will be the lblight executable, web.config (to tell IIS to run the Go based binary), lblight.json and your cert files (crt,key).

## TODO

(see github repo for up to date issues)

- Round robin backend selection
- Least # active connections backend selection
- Health check for backend
- Azure App Service running (HTTP and HTTPS)
- Web sockets via Azure App Service
- Prometheus endpoint for metrics
- Keep connections to destination host open (allow pooling)
- Prove can handle 1000 parallel web sockets
- Improve logging

repository: kpfaulkner/lblight

repo_name: kpfaulkner/lblight


text:
---
title: Data plane proxy authentication
---

To obtain a configuration from the control-plane, a data plane proxy must authenticate itself. There are several authentication methods availble.

## Service Account Token

On Kubernetes, a data plane proxy proves its identity with the [Service Account Token](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#bound-service-account-token-volume) that is mounted in every pod.

Keep in mind that if you don't explicitly specify `serviceAccountTokenName` in Deployment, the Pod is run with the `default` Service Account Token in the Namespace.
This means that authentication scope is bound to a Namespace, so any Pod in the Namespace can authenticate as any other Pod in a Namespace.

To have a strict security bound to a Deployment, every Deployment should use unique Service Account Token.
On top of that, users should not be able to modify `serviceAccountTokenName` in `Deployment`. This can be achieved for example with [OPA Gatekeeper](https://open-policy-agent.github.io/gatekeeper/website/docs/).

Service Account Token is not bound to a mesh, see [data plane proxy membership](/docs/{{ page.version }}/security/dp-membership) how to restrict which Pods can join a mesh.

## Data plane proxy token

On Universal, a data plane proxy must be explicitly configured with a unique security token (data plane proxy token) that will be used to prove its identity.

The data plane proxy token is a [JWT token](https://jwt.io) that contains:
* Mesh to which data plane belongs (required)
* The name of a data plane proxy (optional)
* List of tags that are permitted to use (optional)
* Expiration date of the token (required, 10 years if not specified)

The Data plane proxy token is signed by a signing key that is autogenerated when Mesh is created.
Tokens are never stored in the control plane, the only thing that is stored are signing keys that are used to verify if a token is valid.
The signing key is RSA256 encrypted.

You can check for the signing key:
```sh
kumactl get secrets
```
which returns something like:
```
MESH      NAME                                    AGE
default   dataplane-token-signing-key-default-1   49s
```

### Usage

You can generate token either by REST API
```bash
curl -XPOST \
  -H "Content-Type: application/json" \
  --data '{"name": "dp-echo-1", "mesh": "default", "tags": {"kuma.io/service": ["backend", "backend-admin"]}, "validFor": "720h"}' \
  http://localhost:5681/tokens/dataplane
```

or by using `kumactl`
```bash
kumactl generate dataplane-token \
  --name dp-echo-1 \
  --mesh default \
  --tag kuma.io/service=backend,backend-admin \
  --valid-for 720h > /tmp/kuma-dp-echo1-token
```

The token should be stored in a file and then used when starting `kuma-dp`
```bash
kuma-dp run \
  --cp-address=https://<IP_ADDRESS>:5678 \
  --dataplane-file=dp-backend.yaml \
  --dataplane-token-file=/tmp/kuma-dp-echo-1-token
```

You can also pass Dataplane Token inline as `KUMA_DATAPLANE_RUNTIME_TOKEN` Environment Variable.

### Data Plane Proxy Token boundary

As we can see in the example above, we can generate a token by passing a `name`, `mesh`, and a list of tags.
The control plane will then verify the data plane proxy resources that are connecting to it against the token. This means we can generate a token by specifying:

* Only `mesh`. By doing so we can reuse the token for all dataplanes in a given mesh.
* `mesh` + `tag` (ex. `kuma.io/service`). This way we can use one token across all instances/replicas of the given service.
  Please keep in mind that we have to specify to include all the services that a data plane proxy is in charge of.
  For example, if we have a Dataplane with two inbounds, one valued with `kuma.io/service: backend` and one with `kuma.io/service: backend-admin`, we need to specify both values (`--tag kuma.io/service=backend,backend-admin`).
* `mesh` + `name` + `tag` (ex. `kuma.io/service`). This way we can use one token for one instance/replica of the given service.

### Token Revocation

Kuma does not keep the list of issued tokens. Whenever the single token is compromised, we can add it to revocation list so it's no longer valid.

Every token has its own ID which is available in payload under `jti` key. You can extract ID from token using jwt.io or [`jwt-cli`](https://www.npmjs.com/package/jwt-cli) tool. Here is example of `jti`
```
0e120ec9-6b42-495d-9758-07b59fe86fb9
```

Specify list of revoked IDs separated by `,` and store it as `Secret` named `dataplane-token-revocations-{mesh}`

{% tabs token-revokation useUrlFragment=false %}
{% tab token-revokation Universal %}
```sh
echo "
type: Secret
mesh: default
name: dataplane-token-revocations-default
data: {{ revocations }}" | kumactl apply --var revocations=$(echo '0e120ec9-6b42-495d-9758-07b59fe86fb9' | base64) -f -
```
{% endtab %}
{% tab token-revokation Kubernetes %}
```sh
REVOCATIONS=$(echo '0e120ec9-6b42-495d-9758-07b59fe86fb9' | base64) && echo "apiVersion: v1
kind: Secret
metadata:
  name: dataplane-token-revocations-default
  namespace: {{site.mesh_namespace}}
data:
  value: $REVOCATIONS
type: system.kuma.io/secret" | kubectl apply -f -
```
{% endtab %}
{% endtabs %}

### Signing key rotation

If the signing key is compromised, we must rotate it and all the tokens that was signed by it.

1. Generate new signing key
   The signing key is stored as a `Secret` with a name that looks like `dataplane-token-signing-key-{mesh}-{serialNumber}`.

   Make sure to generate the new signing key with a serial number greater than the serial number of the current signing key.

   {% capture tabs %}
   {% tabs key-rotation useUrlFragment=false %}
   {% tab key-rotation Universal %}
   Check what is the current highest serial number.
   ```sh
   kumactl get secrets
   MESH      NAME                                    AGE
   default   dataplane-token-signing-key-default-1   49s
   ```

   In this case, the highest serial number is `1`. Generate a new signing key with a serial number of `2`
   ```sh
   echo "
   type: Secret
   mesh: default
   name: dataplane-token-signing-key-default-2
   data: {{ key }}" | kumactl apply --var key=$(kumactl generate signing-key) -f -
   ```
   {% endtab %}
   {% tab key-rotation Kubernetes %}
   Check what is the current highest serial number.

   ```sh
   kubectl get secrets -n {{site.mesh_namespace}} --field-selector='type=system.kuma.io/secret'
   NAME                                 TYPE                    DATA   AGE
   dataplane-token-signing-key-mesh-1   system.kuma.io/secret   1      25m
   ```

   In this case, the highest serial number is `1`. Generate a new signing key with a serial number of `2`
   ```sh
   TOKEN="$(kumactl generate signing-key)" && echo "
   apiVersion: v1
   data:
     value: $TOKEN
   kind: Secret
   metadata:
     name: dataplane-token-signing-key-mesh-2
     namespace: {{site.mesh_namespace}}
   type: system.kuma.io/secret
   " | kubectl apply -f -
   ```

   {% endtab %}
   {% endtabs %}
   {% endcapture %}
   {{ tabs | indent }}

2. Regenerate tokens
   Create new data plane proxy tokens. These tokens are automatically created with the signing key that’s assigned the highest serial number, so they’re created with the new signing key.
   At this point, tokens signed by either new or old signing key are valid.

3. Remove the old signing key
   {% capture tabs %}
   {% tabs remove-key useUrlFragment=false %}
   {% tab remove-key Universal %}
   ```sh
   kumactl delete secret dataplane-token-signing-key-default-1 --mesh=default
   ```
   {% endtab %}
   {% tab remove-key Kubernetes %}
   ```sh
   kubectl delete secret dataplane-token-signing-key-default-1 -n {{site.mesh_namespace}}
   ```
   {% endtab %}
   {% endtabs %}
   {% endcapture %}
   {{ tabs | indent }}
   All new connections to the control plane now require tokens signed with the new signing key.

### Multizone

When running in multizone, mode we can generate data plane proxy token both on global and zone control plane.
If the deployment pipeline is configured to generate data plane proxy token before running the proxy, it can rely on the Zone CP. This way Global CP is not a single point of failure.
Signing key rotation or token revocation should be performed on the global control plane.

## None

We can turn off the authentication by setting `KUMA_DP_SERVER_AUTH_TYPE` to `none`.

{% warning %}
If we disable the authentication between the control plane and the data plane proxies, any data plane proxy will be able to impersonate any service, therefore this is not recommended in production.
{% endwarning %}

gha_language: SCSS


text:
# Circulation Manager Administrative Interface

[![Test Client & Deploy Documentation](https://github.com/lyrasis/simplye-circulation-web/actions/workflows/test-and-deploy.yml/badge.svg?branch=main)](https://github.com/lyrasis/simplye-circulation-web/actions/workflows/test-and-deploy.yml)

This is a [LYRASIS](http://lyrasis.org)-maintained fork of the NYPL [Library Simplified](http://www.librarysimplified.org/) Circulation Manager administrative interface.

## Library Simplified Documentation

To see screenshots, read in-depth documentation, and find out more about the project, check out the [Confluence](https://confluence.nypl.org/display/SIM/) site hosted by The New York Public Library.

## Setup

This package is meant to be used with the Library Simplified [Circulation Manager](https://github.com/NYPL-Simplified/circulation).

#### Use npm version

Suggested local folder setup:

- `/[path to project folder]/circulation`

To use the published version with your circulation manager, run `npm install` from `api/admin` in the `circulation` local installed repository.

#### Use local development version

Suggested local folder setup:

- `/[path to project folder]/circulation`
- `/[path to project folder]/circulation-web`

If you're working on the administrative interface and want to test local changes, you can link your local clone of this repository to your local circulation manager. These steps will allow you to work on the front-end administrative interface and see updates while developing.

1. Run `npm link` in this `circulation-web` repository,
2. run `npm link simplified-circulation-web` from `api/admin` in the `circulation` repository,
3. run the circulation manager using `python app.py` at the root in the `circulation` repository,
4. run the web interface using `npm run dev` at the root of this `circulation-web` repository,
5. visit `localhost:6500/admin/`

Webpack will take care of compiling and updating any new changes made locally for development. Just refresh the page to see updates without having to restart either the `circulation` or `circulation-web` servers.

## Web Catalog

The Circulation Manager administrative interface relies on the [OPDS Web Catalog](https://github.com/NYPL-Simplified/opds-web-client) as its base React component and application. For more information, please check out the repository.

## Publishing

This package is [published to npm](https://www.npmjs.com/package/simplified-circulation-web).

To publish a new version, you need to create an npm account and be a collaborator on the package. Then you can run `npm publish` from your local copy of the repository.

## Accessibility

In order to develop user interfaces that are accessible to everyone, there are tools added to the workflow. Besides the Typescript `tslint-react-a11y` plugin, `react-axe` is also installed for local development. Using that module while running the app uses a lot of resources so it should be only when specifically testing for accessibility and not while actively developing new features or fixing bugs.

In order to run the app with `react-axe`, run `npm run dev-test-axe`. This will add a local global variable `process.env.TEST_AXE` (through webpack) that will trigger `react-axe` in `/src/index.tsx`. The output will be seen in the _browser's_ console terminal.

## Tests

### Unit Tests

Like the codebase, all the unit tests are written in Typescript. Tests are written for all React components as well as redux and utility functions, and all can be found in their respective `__tests__` folders.

To run the tests, perform `npm test`.

We use Travis CI for continuous integration. Any pull requests submitted must have tests and those tests must pass on Travis CI.

### Nightwatch

There are end-to-end tests that run on Nightwatch. This selenium-based test runner allows us to include integration tests for logging into the admin and clicking through different pages.

To set up credentials and run the tests, check out the [README](/tests/README.md) in `/tests/.

## License

```
Copyright © 2015 The New York Public Library, Astor, Lenox, and Tilden Foundations

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

repository: jonathangreen/circulation-admin

repo_name: jonathangreen/circulation-admin


text:
# Hypoxylon maculatum (Theiss.) J.H. Mill., 1961 SPECIES

#### Status
SYNONYM

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

#### Published in
Monogr. World spec. Hypoxylon 128 (1961)

#### Original name
Nummularia maculata Theiss., 1908

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Sordariomycetes/Xylariales/Xylariaceae/Whalleya/Whalleya maculata/ Syn. Hypoxylon maculatum/README.md

repo_name: mdoering/backbone


text:
# dataVariance
This is a package for measuring data variance amidst a computation S4 object.

For an example of measuring the difference between two kallisto Experiments, please see the package artemis, and artemisData.  From artemisData, we can load two Kallisto Experiments and compare their differences.

>library(artemisVariance)
>data(kexpNew)
>data(kexpOriginal)
>diff<-findPercentDifferenceAssays(kexpNew,kexpOriginal)
>kde<-findOutliers(diff)

repository: RamsinghLab/Arkas-RNASeq

repo_name: RamsinghLab/Arkas-RNASeq


text:
+++
abstract = ""
abstract_short = ""
authors = ["Somak Aditya", "Yezhou Yang", "Chitta Baral", "Cornelia Fermuller", "Yiannis Aloimonos"]
date = "2015-03-12"
image_preview = ""
math = true
publication_types = ["1"]
publication = "In AAAI Spring Symposium Series. 2015"
publication_short = "In *AAAI Spring Symposium, 2015*"
selected = true
title = "Visual common-sense for scene understanding using perception, semantic parsing and reasoning."
projects = ["Vision", "NLP"]
url_pdf = "http://www.public.asu.edu/~cbaral/papers/cs2015vision.pdf"
# url_project = "#"
url_slides = "pdf/commonsense15.pdf"

# Optional featured image (relative to `static/img/` folder).
[header]
image = "headers/common_sense.png"
caption = "My caption :smile:"

+++

In this paper we explore the use of visual commonsense
knowledge and other kinds of knowledge (such as
domain knowledge, background knowledge, linguistic
knowledge) for scene understanding. In particular, we
combine visual processing with techniques from natural
language understanding (especially semantic parsing),
common-sense reasoning and knowledge representation
and reasoning to improve visual perception to reason
about finer aspects of activities

repository: adityaSomak/academic-kickstart

repo_name: adityaSomak/academic-kickstart


text:
# Memory Mapping Example

This repository provides a platform-independent memory mapping. The test driver
is a simple implementation of `wc -l`.

## Compilation on Linux/macOS

```
clang++ memory_mapping.t.cpp memory_mapping.cpp -Wall -Wextra -march=native -O3 -Wpedantic -std=c++17
```

## Compilation on Windows

```
cl memory_mapping.t.cpp memory_mapping.cpp /std:c++17 /O2 /FA /EHsc /GL /Ob2 /nologo
```

## Performance

I counted the newlines in the source code of CSPICE
(https://naif.jpl.nasa.gov/naif/toolkit_C.html) using macOS:

```
# File-based
$ ./a.out cspice/src/cspice/*.c
# Map-based
$ NZL_USE_MAP=1 ./a.out cspice/src/cspice/*.c
```

Some timings (nanoseconds):

```
Using MemoryMapping
79833000
80383000
81283000
77522000

Using file-based I/O
150205000
150359000
149858000
149975000
```

The memory mapping implementation performs an order of magnitude faster than the
file-based implementation (there are ways to make the file-based implementation
go faster, but that's not the point of this example).


text:
[back to resource list](https://github.com/sous-chefs/keepalived#resources)

---

# keepalived_real_server

The `keepalived_real_server` resource can be used to configure real_server blocks within a `virtual_server`. They are managed as separate configuration files, and injected into the `virtual_server` block via `include` directives configured via the `real_servers` property of the `keepalived_virtual_server` resource.

A `keepalived_real_server` can be associated with a healthcheck via an `include` of a file containing a check sub-block using the `healthcheck` property. If using any of the health check resources provided by this cookbook, you can use the `config_file` method on the associated resource to automatically get the appropriate configuration path, as shown below.

More information available at <https://www.keepalived.org/manpage.html>

## Actions

- `:create`
- `:delete`

## Properties

| Name                  | Type          |  Default | Description | Allowed Values |
----------------------- | ------------- | -------- | ----------- | -------------- |
| `ipaddress`           | `String`      | `nil` | IP Address of the Server | |
| `port`                | `Integer`     | `nil` | Port of the Server | |
| `healthcheck`         | `String`      | `nil` | Includes a healthcheck file | |
| `weight`              | `Integer`     | `nil` | Script to run for notifications when any transition of state happens | |
| `inhibit_on_failure`  | `true, false` | `nil` | | |
| `notify_up`           | `String`      | `nil`| Script to execute when healthchecker considers the service as up | |
| `notify_down`         | `String`      | `nil`| Script to execute when healthchecker considers the service as down | |
| `config_directory`      | `String` | `/etc/keepalived/servers.d` | directory for the config file to reside in | |
| `config_file`         | `String` | `::File.join(config_directory, 'keepalived_real_server__#{ipaddress}-#{port}__.conf')` | full path to the config file | |
| `cookbook`            | `String` | `keepalived` | Which cookbook to look in for the template | |
| `source`              | `String` | `real_server.conf.erb` | Name of the template to render | |

## Examples

```ruby
keepalived_real_server 'Secure Web Server' do
  ipaddress ipaddress
  port      port
  notify_up '/usr/local/bin/keepalived-notify-up.sh'
  notify_down '/usr/local/bin/keepalived-notify-down.sh'
  inhibit_on_failure true
  notifies :restart, 'service[keepalived]', :delayed
end
```

```ruby
keepalived_http_get 'health_check_url' do
  nb_get_retry 3
  url path: '/health_check', status_code: 200
  notifies :restart, 'service[keepalived]', :delayed
end

keepalived_real_server 'fe01' do
  ipaddress '<IP_ADDRESS>'
  port 80
  weight 5
  inhibit_on_failure true
  healthcheck resources(keepalived_http_get: 'health_check_url').config_file
  notifies :restart, 'service[keepalived]', :delayed
end
```


text:
# dotfiles

Dotfiles and setup scripts to automate macOS setup.

[Homebrew](https://brew.sh/) is used for package management and
[ASDF](https://github.com/asdf-vm/asdf) for managing programming languages.

## Install

```bash
git clone git@github.com:dpca/dotfiles.git ~/dotfiles
~/dotfiles/setup/mac
```

Run `rcup` after adding new files to the directory to properly symlink them.

## Settings

* System
  * Remap caps lock to control

* Trackpad
  * Scroll direction: NOT NATURAL
  * Look up & data detectors: Yes
  * Swipe between pages: 3 fingers
  * Swipe between full-screen apps: 4 fingers
  * Mission control: 4 fingers
  * App Expose: Down w/ 4 fingers

* Terminal
  * [Dracula](https://draculatheme.com/) color theme
  * [Powerlevel10k](https://github.com/romkatv/powerlevel10k) zsh theme
    * Meslo Nerd Font patched for Powerlevel10k
  * Use option as Meta key

## Acknowledgements

Many thanks to [Thoughtbot](https://thoughtbot.com/) for their
[laptop](https://github.com/thoughtbot/laptop) and
[dotfiles](https://github.com/thoughtbot/dotfiles) repos, which served as the
starting point for this repo.

repository: dpca/dotfiles

repo_name: dpca/dotfiles


text:
Euclid [![Build Status (Travis)][badge-travis]][build-travis] [![Build Status (Appveyor)][badge-appveyor]][build-appveyor]
======

Euclid will be a UI framework for terminal environments, like actual desktop
terminal emulator or [rot.js][rot-js].

Build
-----

To build the project (just a stub for now), install [SBT][sbt] and then execute
the following command in your terminal:

```console
$ sbt compile
```

Test
----

To execute the automatic test suite, run the following command in your terminal:

```console
$ sbt test
```

Run
---

To run the manual test projects (just stubs for now) for JVM and Scala.js,
execute the following commands in your terminal.

For JVM test:

```console
$ sbt 'project euclidJVM' run
```

For JS test:

```console
$ sbt 'project euclidJS' fastOptJS::webpack
```

After that open `js/target/scala-2.12/classes/index.html` in your browser.

[build-appveyor]: https://ci.appveyor.com/project/ForNeVeR/euclid/branch/master
[build-travis]: https://travis-ci.org/codingteam/euclid
[rot-js]: http://ondras.github.io/rot.js/hp/
[sbt]: http://www.scala-sbt.org/

[badge-appveyor]: https://ci.appveyor.com/api/projects/status/gr42tg6db572jts6/branch/master?svg=true
[badge-travis]: https://travis-ci.org/codingteam/euclid.svg?branch=master

repository: codingteam/euclid

gha_language: Scala

repo_name: codingteam/euclid


text:
# Project 1: Eva Krebs, Christian Flach - Jupyter Notebooks in Squeak/Smalltalk

## Project Description

- Notebooks in Squeak/Smalltalk
  - Load and save (export) notebook files
  - Notebook UI, support for object inspector and charts, …
- Experiment with multi-language support in notebooks (Smalltalk, Ruby, Python, JavaScript, LLVM, …)

![](motivation.png)


text:
# Kidle user guide

Kidle is a Kubernetes operator that provides an idling feature to automatically idle or wakeup workloads.

## Introduction

The Kidle CRD introduces a new kubernetes resource named `IdlingResource`. A single `IdlingResource` instance will drive the idle status of a single workload.

The supported workload types are:

- Deployment
- StatefulSet
- CronJob

The `IdlingResource` has a boolean field `spec.idle`.
When the value is `true`, the Kidle operator will idle the workload.
Set it back to `false` to wakeup the workload.

During the **idling phase**, Kidle's operator will scale down the deployments and the statefulsets to 0.
The cronjobs `spec.suspend` field is set to `true`.
Before the scale down, Kidle saves the previous replicas state for the wakeup phase.

The **wakeup phase** restores the previous replicas state on deployments and statefulsets.
The cronjobs `spec.suspend` field is set back to `false`.

When deleting an `IdlingResource` objet on a idled workload, the operator will wakeup the referenced workload.

There are several idling strategies:

1. manual: play around with the idle field
1. cronjob: idle and wakeup times defined by cron expressions

## Installation
### Prerequisites
- golang >=1.16
- [k3d](https://github.com/rancher/k3d)

### Run the operator on a local k3s cluster
```bash
# start a local k3s cluster
make k3s-registry k3s-create k3s-kubeconfig

# set proper KUBECONFIG env var
export KUBECONFIG=$(pwd)/kube.config

# Install the CRD
make install

# Start the operator
make WHAT=operator run
```

### Kidlectl

```bash
# Run kidlectl using golang
make WHAT=kidlectl run

# or build kidlectl
make WHAT=kidlectl build
./cmd/kidlectl/bin/kidlectl
```

The output is:
```
Please specify one command of: idle or wakeup
Usage:
  kidlectl [OPTIONS] <idle | wakeup>

Application Options:
      --kubeconfig= path to Kubernetes config file [$KUBECONFIG]

Help Options:
  -h, --help        Show this help message

Available commands:
  idle    idle the referenced object of an IdlingResource (aliases: i)
  wakeup  wakeup the referenced object of an IdlingResource (aliases: w)
```

## Quickstart

First, create a Deployment:
```bash
$ kubectl create deploy --replicas=2 --image=stefanprodan/podinfo podinfo
```

Then, create an `IdlingResource` object. Here is the most basic form which enables **manual idling of a Deployment**:

```yaml
apiVersion: kidle.kidle.dev/v1beta1
kind: IdlingResource
metadata:
  name: podinfo
spec:
  # Reference of the workload to idle
  idlingResourceRef:
    apiVersion: apps/v1
    kind: Deployment
    name: podinfo

  # Idle or not?
  idle: false
```

- This create an `IdlingResource` object that references the Deployment named podinfo.
- The initial idle status is `false`.

At this point, the Deployment still have 2 replicas:

```bash
$ kubectl get pods
NAME                       READY   STATUS    RESTARTS   AGE
podinfo-7fbb45ccfc-kg42f   1/1     Running   0          6s
podinfo-7fbb45ccfc-mlrzf   1/1     Running   0          6s
```

You can **get the idling status** on the `IdlingResource` object:
```bash
$ kubectl get idlingresources
NAME      IDLE    REFKIND      REFNAME
podinfo   false   Deployment   podinfo
```

To **idle the Deployment**, you can either:

1. edit the `IdlingResource` and set the `spec.idle` field to `false`
  ```bash
  $ kubectl edit ir/podinfo
  ```
2. or use `kidlectl` for a simple single line command:
  ```bash
  $ kidlectl idle podinfo
  2021-09-20T12:52:12.996+0200	INFO	idling	{"namespace": "kidle-demo", "name": "podinfo"}
  2021-09-20T12:52:13.002+0200	INFO	scaled to 0	{"namespace": "kidle-demo", "name": "podinfo"}
  ```

Now **the Deployment is idle** and have no pods anymore:
```bash
$ kubectl get pods
No resources found in kidle-demo namespace.

$ kubectl get deploy
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   0/0     0            0           8m53s

$ kubectl get idlingresources
NAME      IDLE    REFKIND      REFNAME
podinfo   true   Deployment   podinfo
```

You can track the Kidle operator activity on the `IdlingResource` events:
```bash
$ kubectl describe ir/podinfo
...
Events:
  Type    Reason             Age   From                       Message
  ----    ------             ----  ----                       -------
  Normal  Added              50s   idlingresource-controller  Object finalizer is added
  Normal  ScalingDeployment  19s   idlingresource-controller  Scaled to 0
  Normal  ScalingDeployment  2s    idlingresource-controller  Scaled to 2

```

## Cronjob idle strategy

The cronjob idle strategy schedules idle and wakeup phases using a cron expression:

```yaml
apiVersion: kidle.kidle.dev/v1beta1
kind: IdlingResource
metadata:
  name: podinfo
spec:
  # Reference of the workload to idle
  idlingResourceRef:
    apiVersion: apps/v1
    kind: Deployment
    name: podinfo

  # Idle or not?
  idle: false

  # Scheduled idle time using cronjob
  idlingStrategy:
    cronStrategy:
      schedule: "*/2 * * * *"

  # Scheduled wakeup time using cronjob
  wakeupStrategy:
    cronStrategy:
      schedule: "1-59/2 * * * *"
```

The Kidle operator will create kubernetes cronjobs:
```bash
$ kubectl get cronjobs
NAME                   SCHEDULE         SUSPEND   ACTIVE   LAST SCHEDULE   AGE
kidle-podinfo-idle     */2 * * * *      False     0        98s             6m43s
kidle-podinfo-wakeup   1-59/2 * * * *   False     0        38s             6m43s
```

The cronjob is based on the `kidlectl` image and run a basic `kidlectl <idle|wakeup> podinfo` command inside the job pod:

```bash
$ kubectl logs jobs/kidle-podinfo-wakeup-27202409
2021-09-20T13:29:02.241Z	INFO	waking up	{"namespace": "kidle-demo", "name": "podinfo"}
2021-09-20T13:29:02.265Z	INFO	waked up	{"namespace": "kidle-demo", "name": "podinfo"}
```

In order to make `kidlectl` work inside a pod, a dedicated service account, role and role binding are created per `IdlingResource`:

```bash
$ kubectl get serviceaccount,role,rolebinding
NAME                              SECRETS   AGE
serviceaccount/default            1         6h13m
serviceaccount/kidle-podinfo-sa   1         64m

NAME                                                CREATED AT
role.rbac.authorization.k8s.io/kidle-podinfo-role   2021-09-20T12:38:22Z

NAME                                                     ROLE                      AGE
rolebinding.rbac.authorization.k8s.io/kidle-podinfo-rb   Role/kidle-podinfo-role   64m
```

## Supported workloads
Here are examples for each workload supported by Kidle:

**Deployment**:
```yaml
spec:
  idlingResourceRef:
    apiVersion: apps/v1
    kind: Deployment
    name: deployment-name
```

**StatefulSet**:
```yaml
spec:
  idlingResourceRef:
    apiVersion: apps/v1
    kind: StatefulSet
    name: statefulset-name
```

**CronJob**:
```yaml
spec:
  idlingResourceRef:
    apiVersion: batch/v1
    kind: CronJob
    name: cronjob-name
```

or:
```yaml
spec:
  idlingResourceRef:
    apiVersion: batch/v1beta1
    kind: CronJob
    name: cronjob-name
```

repository: Animeshz/kidle

repo_name: Animeshz/kidle


text:
---
layout: post
category : linux
tagline: "使用watch命令来监控日志"
tags : [watch, tail]
---

http://jamesseibel.com/blog/?p=11

How to Tail a Directory in Linux
Posted on July 30, 2012
I’m often tailing log files and whatnot during my development and debugging process. However, I stumbled into a situation where (for various complicated reasons) the best way to solve a problem was to touch files on disk and use those to drive execution. Unfortunately, I didn’t have an easy way to view the live changes to a directory as I stepped through my code. Luckily, where there is will there is a way:

watch "tail -n 3 /var/baoz/stat/workspace/logs/s11.baoz.cn/access/* >> s1.log"

dtruss
dtrace

strace


text:
Code developed during the udemy course "Clean Code: Testgetriebene Softwareentwicklung (TDD)"
=============================================================================================

This German course is taught on Udemy by Thorsten Diekhof: https://www.udemy.com/course/clean-code-testgetriebene-softwareentwicklung-test-driven-development/

repository: keneanung/GameOfLife-TDD-Course

repo_name: keneanung/GameOfLife-TDD-Course


text:
# zosjobs command

[![Build Status](https://travis-ci.org/crshnburn/zosjobs.svg?branch=master)](https://travis-ci.org/crshnburn/zosjobs)
[![codecov](https://codecov.io/gh/crshnburn/zosjobs/branch/master/graph/badge.svg)](https://codecov.io/gh/crshnburn/zosjobs)

Command line tool to retrieve z/OS Job Output and display on the console.

Makes use of the [zOSMF REST API](https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.izua700/IZUHPINFO_API_RESTJOBS.htm).

![zosjobs example](doc/zosjobs.gif)

## Installation

1. `npm install -g zosjobs`

## Usage

```text
  Usage: zosjobs [options]

  Options:

    -h, --help                 output usage information
    -V, --version              output the version number
    -c, --connUrl [url]        specifies the z/OS MF hostname and port
    -u, --user [user]          specifies the user ID
    -p, --password [password]  specifies the password
    -o, --owner [owner]        the owner of the jobs to retrieve
```

## License

```text
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

repository: crshnburn/zosjobs

gha_language: JavaScript

repo_name: crshnburn/zosjobs


text:
The GPG TextMate bundle
=======================

Features:
---------

- Encrypt file using gpg
- Decrypt file using gpg

Installation:
-------------

    cd ~/Library/Application Support/TextMate/Bundles # for local install
    # or
    cd /Library/Application Support/TextMate/Bundles # for global install
    git clone git://github.com/jigfox/GPG.tmbundle.git

Usage:
------

Hit "⌃⌥⌘G" and then hit 1 or 2 for Decryption or Encryption

License:
--------

[MIT-License](http://www.opensource.org/licenses/mit-license.php)

Thanks:
-------

Code Based on: [http://www.leancrew.com/all-this/2007/10/gpg-and-textmate/](http://www.leancrew.com/all-this/2007/10/gpg-and-textmate/)


text:
# SVCodable

Simple JSON Object conversion with help of `Codable` and `extension`.

[![Platform](https://img.shields.io/badge/platform-iOS-green.svg)]()
![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)
[![Swift Package Manager](https://rawgit.com/jlyonsmith/artwork/master/SwiftPackageManager/swiftpackagemanager-compatible.svg)](https://swift.org/package-manager/)

SVCodable is a extension written in Swift that makes it easy for you to convert your model objects (classes and structs) to and from JSON.

# The Basics
To support mapping, a class or struct just needs to implement the ```Codable``` protocol which includes the following functions:

### To JSON:

```Swift
import SVCodable

struct Message: Codable {
    let sender: String
    let text: String
    let time: TimeInterval
}

let message = Message(sender: "Kaka", text: "Hello", time:<PHONE_NUMBER>0)

let jsonDictionary:[String : Any] = message.toJSON()
let jsonString:String? = message.toJSONString()
let jsonData:Data? = message.toJSONData()

```

### From JSON:

```Swift
let messageStr = """
    {
       "sender": "Kaka",
       "text": "Hello",
       "time":<PHONE_NUMBER>0
    }
"""

let message = Message.map(JSONString: messageStr)

```

repository: satishVekariya/SVCodable

repo_name: satishVekariya/SVCodable


text:
# Help
*01/26/2019* author Vincent Berthet - source [Wikipedia](https://en.wikipedia.org/wiki/Conway's_Game_of_Life)

[GitLab project](https://gitlab.com/Kyross/game_of_life)
## Table of contents

- [Help](#help)
  - [Table of contents](#table-of-contents)
  - [Introduction](#introduction)
  - [Rules](#rules)
  - [Controls](#controls)
    - [Game Control](#game-control)
    - [Application](#application)
    - [Options](#options)
      - [Parameters](#parameters)
      - [Game mode](#game-mode)
      - [Demo](#demo)

## Introduction
The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.

The game is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves, or, for advanced players, by creating patterns with particular properties.

## Rules
The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive or dead, (or populated and unpopulated, respectively). Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

    Any live cell with fewer than two live neighbors dies, as if by underpopulation.
    Any live cell with two or three live neighbors lives on to the next generation.
    Any live cell with more than three live neighbors dies, as if by overpopulation.
    Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.

 *You can change the rules in Option>Parameters>Game Mode*

The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed; births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick. Each generation is a pure function of the preceding one. The rules continue to be applied repeatedly to create further generations.

## Controls

### Game Control
>**Left Click :** Fill a cell *(you can hold and move the mouse to fill multiple cell)*

>**Right Click :** Unfill a cell *(you can hold and move the mouse to unfill multiple cell)*

>**File (Ctrl+N) :** Reset the game and all of his parameter

>**Open (Ctrl+O) :** Open a *.life model

>**Save (Ctrl+S) :** Save the current paint and his parameters in a *.life

>**Run (F5) :** Run the generation until no more generation are available

>**Pause (F6) :** Pause the generation

>**Clear (F7) :** Clear all the grid

### Application
>**Quit (Ctrl+Q) :** Close all windows of the application

>**Maximized :** Display the MainWindow in maximized

>**FullScreen :** Display the MainWindow in fullscreen

>**Normal :** Display the MainWindow in the last resized state

### Options

#### Parameters
>**Universe :** The size of the grid *(not editable when the grid is not empty)*

>**Timer :** The interval between generations occurs

>**Color :** The color of the painted cells

#### Game mode
You can edit the rules of the game to change the cell actions depending of their neighbourhood
* Born condition
* Stase condition
* Dead body *(a cell cannot spawn if a cell has already died on this spot)*
#### Demo
You can find different kind of model to try the game
* Random
* Stable
* Oscillator
* Canon

repository: RealVincentBerthet/GoL

repo_name: RealVincentBerthet/GoL


text:
Do not keep obsolete versions of files under the virtual web server
root.

When updating the site, delete or move the files to a directory
outside the virtual root, edit them there, and move (or copy) the
files back to the virtual root. Make sure that only the files that are
actually in use reside under the virtual root.

Preventing access
without authentication may also be an option and stop a client being
able to view the contents of a file, however it is still likely that
the filenames will be able to be discovered.

Using obscure filenames
is only implementing security through obscurity and is not a
recommended option.


text:
---
comments: true
date: 2009-05-06 17:47:32
layout: post
slug: psp3000-hacking-forwarding-chickhen-released
title: PSP3000破解进一步 ChickHEN发布
wordpress_id: 22
categories:
- Video Game
tags:
- 破解
- Homebrew
- PSP
---

PSP3000的破解比想象的慢了很多很多，甚至让我也觉得希望渺茫，另外，因为体验到了PSN（Playstation@Network的简称），让我觉得能作为正版用户也是非常不错的。不过因为怂恿了家人买3000，并且当时认为一定能被破解，所以也一直关注破解的进程。

虽然之前的各种溢出漏洞都没有真正能被利用，Gridshift的漏洞也只是简单的运行一些小程序段步伐进入kernel mode而已，不过在出现TIFF漏洞之后似乎看到了曙光。当年PSP1000破解工作就是在2.70时代的TIFF漏洞中找到了契机，而最终演变成了如今这繁荣昌盛的D版市场。

经过几次的延期，第一个HEN系统ChickHEN Homebrew Enabler终于还是出现了。能提供一个可以运行Homebrew的环境。Alek也在[Sceners.org](http://www.sceners.org/)上写了相关的文章《[ChickHEN Eggsploited!](http://sceners.org/index.php?id=25)》

下载请至：[Davee's DevSite](http://davee.x-fusion.co.uk/)

[![](/images/uploads/zb/davee.png)](http://davee.x-fusion.co.uk/)

>

>
> 5.03 ChickHEN Homebrew Enabler - Team Typhoon (Article by Granite) So comes the release of the highly anticipated ChickHEN homebrew enabler by Team Typhoon. After 1800 Lines of code, 4 weeks of stressful developing and countless amounts of tests the dawn of a new homebrew era for all the 3000, 2000 and 1000 users is on the horizon. What was said to be impossible by many is now a reality, all styles homebrew are now running on the "unhackable" T88v3 and TA-090 motherboards rolled out by Sony.

What does the ChickHEN do?

ChickHEN as a Homebrew Enabler that allows the execution of homebrew via the PSP XMB. Running via a vulnerability in the lib TIFF the launcher takes advantage of the system by performing a kernel exploit and rebooting into a homebrew enabled enviroment. The ChickHEN remains active until the PSP is fully reset in which case official firmware loads from the flash. ChickHEN unlike other HEN's doesn't touch the flash0 and resides completely in memory. The h.bin supplied in this download consists of a loader and systemex, which is a inversed order of systemctrl and rebootex

What ChickHEN does NOT do?

-Run ISO, CSO or any other form of UMD backup.

-Run PSX Games

-Touch The Flash of your beloved PSP

-Magically allow the use of Custom Firmware

-Load plugins

How do i get the HEN to run on my PSP?

1.

2. Copy h.bin over to the MS ROOT and safely remove device.

2. Scroll over to the PHOTO icon on the XMB and click the ChickHEN folder and wait. (This will not work the first time, you may have to just use a method of loading that works for you but this is what we have found most efficient)

3. If all goes well the screen should blank out and flash green showing that the HEN is loaded and all is well.

4. Wait for your PSP to reboot and check your PSP's system software. It should now display: "5.03 ChickHEN".

5. Scroll on over to GAME and enjoy some Homebrew!

Disclaimer:

This software should not be used in conjunction with software which can enable the usage or disable the protections of copyrighted content. We will not be held responsible for any damage to your PSP system. This software comes with no warrenty.

Credits:

Team Typhoon: ChickHEN

MaTiAz: TIFF Eggsploit ;)

Lawrence Jackson (LCJ14) - PSP 3000

MforMature staff: For everything

Everyone else who gave help during the development

SHA-1 of h.bin: 39339DF6D67DA88BDFF78261222AAADAEBCD9203

http://davee.x-fusion.co.uk
>
>

extension: markdown


text:
# remark-mdx-images

[![github actions][github actions badge]][github actions] [![npm][npm badge]][npm]
[![prettier][prettier badge]][prettier]

> A [remark][] plugin for changing image sources to JavaScript imports using MDX

## Installation

```sh
npm install remark-mdx-images
```

## Usage

This remark plugin takes markdown images, and converts them into mdx elements `<img />` that use
JavaScript imports to resolve the image source.

For example, given a file named `example.mdx` with the following contents:

```mdx
![Very cute kittens](./kittens.png 'Meow!')
```

The following script:

```js
import { readFileSync } from 'fs';

import { remarkMdxImages } from 'remark-mdx-images';
import { compileSync } from 'xdm';

const { contents } = compileSync(readFileSync('example.mdx'), {
  jsx: true,
  remarkPlugins: [remarkMdxImages],
});
console.log(contents);
```

Roughly yields:

```jsx
import kittens from './kittens.png';

export default function MDXContent() {
  return (
    <p>
      <img alt="Very cute kittens" src={kittens} title="Meow!" />
    </p>
  );
}
```

### Options

#### `resolve`

By default imports are resolved relative to the markdown file. This matches default markdown
behaviour. If this is set to false, this behaviour is removed and URLs are no longer processed. This
allows to import images from `node_modules`. If this is disabled, local images can still be imported
by prepending the path with `./`.

[github actions badge]:
  https://github.com/remcohaszing/remark-mdx-images/actions/workflows/ci.yml/badge.svg
[github actions]: https://github.com/remcohaszing/remark-mdx-images/actions/workflows/ci.yml
[npm badge]: https://img.shields.io/npm/v/remark-mdx-images
[npm]: https://www.npmjs.com/package/remark-mdx-images
[prettier badge]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg
[prettier]: https://prettier.io
[remark]: https://remark.js.org


text:
# Contributing to homebrew-extra

[Homebrew-extra](https://github.com/Linuxbrew/homebrew-extra) contains formulae that are only available and/or only useful on Linux.

### Report a bug

* run `brew update` (twice)
* run and read `brew doctor`
* read [the Troubleshooting Checklist](http://docs.brew.sh/Troubleshooting.html)
* open an issue on the formula's repository

### Submit a version upgrade for the `foo` formula

* check if the same upgrade has been already submitted by [searching the open pull requests for `foo`](https://github.com/Linuxbrew/homebrew-extra/pulls?utf8=✓&q=is%3Apr+is%3Aopen+foo).
* `brew bump-formula-pr --strict foo` with `--url=...` and `--sha256=...` or `--tag=...` and `--revision=...` arguments.

### Add a new formula for `foo` version `2.3.4` from `$URL`

First, please make sure that [the formula belongs in this tap](#what-formulae-belong-here).

* read [the Formula Cookbook](http://docs.brew.sh/Formula-Cookbook.html) or: `brew create $URL` and make edits
* `brew install --build-from-source foo`
* `brew audit --new-formula foo`
* `git commit` with message formatted `foo 2.3.4 (new formula)`
* [open a pull request](http://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request.html) and fix any failing tests

### Contribute a fix to the `foo` formula

* `brew edit foo` and make edits
* leave the [`bottle`](http://www.rubydoc.info/github/Homebrew/brew/master/Formula#bottle-class_method) as-is
* `brew uninstall --force foo`, `brew install --build-from-source foo`, `brew test foo`, and `brew audit --strict foo`
* `git commit` with message formatted `foo: fix <insert details>`
* [open a pull request](http://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request.html) and fix any failing tests

## What formulae belong here?

* A new formula that works on Mac or Linux should go in Homebrew/core.
* A new formula that is Linux-only, and a formula in Linuxbrew/core depends on it, should go in Linuxbrew/core.
* A new formula that is Linux-only, and no formula in Linuxbrew/core depends on it, should go in Linuxbrew/extra.

Thanks!


text:
0.4.1, 2013-11-10
-----------------

  - [build] windows specific bug fixed

0.4.0, 2013-09-21
-----------------

  - [build] "node.js" tech uses "v2/js" as prototype
  - [build] "node.js" tech uses `require()` for modules inclusion
    instead of `/* borschik:include */` (bem/bem-tools#352 workaround)

0.3.6, 2013-08-16
-----------------

  - yana-request: Fix rawBody initial value
  - yana-logger: "transport" param renamed to "file"

0.3.5, 2013-08-12
-----------------

  - yana-request: Body parser should always returns String as `rawBody`

0.3.4, 2013-08-03
-----------------

  - some minors

0.3.3, 2013-07-23
-----------------

  - yana-view: context might be created from routing's `data`
  - other minor refactoring

0.3.2, 2013-07-22
-----------------

  - view's inheritance fixed
  - yana-handler: error-handler fallback fixed to work properly with errors throwen in views

0.3.1, 2013-07-12
-----------------

  - fix #10

0.3.0, 2013-07-08
-----------------

  - all of the code-base was rewritten with [ym](github.com/ymaps/modules) modules system
  - a lot of bugs were fixed
  - some examples and benchmarks added

0.2.2, 2013-03-21
-----------------

  - bug fixed

0.2.1, 2013-03-21
-----------------

  - use [node-cookie](git://github.com/shtylman/node-cookie.git) for cookie parsing instead of
    [cookies](https://github.com/jed/cookies)
  - Yana.Response#setCookie(), Yana.Response#deleteCookie() methods added
  - request body parsers refactoring

0.2.0, 2013-03-20
-----------------

  - App namespace renamed to Yana
  - "cluster" block added for [Node.js Cluster](http://nodejs.org/docs/v0.8.20/api/cluster.html) normalization
  - "router" could now route request base on HTTP-method
  - default error views were renamed for more descriptive names
  - massive code refactoring

0.1.4, 2013-03-01
-----------------

  - static view added (#1)
  - App.Request.parseQS() was renamed to App.Request.parseArgs() (#2)
  - code refactoring

0.1.3, 2013-02-24
-----------------

  - "request" block added for request normalization API
  - "url" block removed (use "request")
  - "state" block removed (use "request")
  - App.Config.params() getter was added
  - App.Http.start() method was renamed to App.Http.run()
  - App.Logger.log() method was renamed to App.Logger.debug()
  - some inaccuracies were fixed in README.md
  - code refactoring

0.1.1, 2013-02-18
-----------------

  - code refactoring
  - examples/silly project added for usage example

0.1.0, 2013-02-16
-----------------

  - project started

repository: narqo/bem-yana

repo_name: narqo/bem-yana


text:
# Cryptr
Cryptr is a GUI for [Hashicorp's Vault](https://www.vaultproject.io/).

Using Cryptr, a user may easily interact with their Vault instance's API: reading, creating, and modifying secrets with ease.

![alt text](app/images/cryptr-demo.png "Cryptr")

## Download Binaries

Current release can be [downloaded here](https://github.com/adobe/cryptr/releases).
Cryptr supports Windows, Linux and Mac OS. It has been tested on Windows 10, Ubuntu 17.04 Desktop, and macOS 10.13 High Sierra.

For *Linux*, use the `.AppImage` files. They are self-contained binaries that run on every major linux distro. Just make it executable and run it. [AppImage information here!](https://appimage.org/)

## Install using Homebrew

Cryptr can be installed via Homebrew where Cryptr is available as a cask. Just type

```
brew cask install cryptr
```

## Building from Source
You only need to do this if you want to contribute code, or run Cryptr in developer mode. (For Linux binaries, see above).

```
git clone https://github.com/jcrowthe/cryptr.git
cd cryptr
npm install
npm run dev
```

## Unique Features

In addition to the default feature-set of Vault, Cryptr adds some things that are "nice to have". Some of these include:
- Secrets can be files
- Underscores in key names show as whitespace. ie. `secret/My_cool_Secret` shows up in the folder structure as `My cool Secret`
- Ability to move secrets.

## License
Apache 2.0 License

## HTTPS
Cryptr will ONLY access Vault servers enabled with HTTPS. These are your secrets. Keep them secret, keep them safe.

The only exception to this is a dev server running locally at `http://<IP_ADDRESS>:<port>`. Cryptr's URL field will automatically change to contain a `http://` prefix when `<IP_ADDRESS>:` is input. (Note the colon, which is required for the prefix to change. A port number provided after the colon is also required. For reference, a default Vault dev server is started on port 8200)

### Auth backends
Currently LDAP, UserPass and Token auth backends are accepted. Most others are not useful for a GUI, but if you feel otherwise, submit a pull request.

# Important Notes about Policies
## Secret Discovery

Cryptr requires that policies associated with a token to be readable by that token. The purpose for this is to discover what secrets are available to the token. An example ACL for a policy found at `sys/policy/demo` would be as follows:

```
path "secret/mysecrets/*" {
  policy = "write"
}

path "sys/policy/demo" {
    policy = "read"
}
```

Only the permission to `read` is advised for the policy. **NOTE: This policy addition is _critical_ to discovering available secrets.** Without this, there is no programatic way for Cryptr to know what secrets it can query to show the user. (Also, for that matter, there is no way for a human using the CLI to discover secrets, except for blindly attempting to `list` potential folders). As such, it is **highly** recommended to do this for all policies. All policies without this ability must necessarily be ignored by Cryptr.

### Globs and Secret Discovery

Cryptr currently only supports glob characters at the folder level (ie. `secret/*`), and not as a suffix (ie. `secret/group*`). This is due to the lack of any ability to list based on a prefix. As noted [here](https://www.vaultproject.io/docs/concepts/policies.html#list), `list` command outputs are not filtered by policy. You are welcome to add `list` permissions on the containing folder, but know that this is not recommended.

repository: derBroBro/cryptr

repo_name: derBroBro/cryptr


text:
---
title: "Last Person to Fit in the Elevator"
description: "Some description ..."
authors: ["lek-tin"]
tags: ["leetcode", "sql"]
categories: ["database"]
date: 2020-03-29T23:44:34-07:00
lastmod: 2020-03-29T23:44:34-07:00
draft: false
archive: false
---

Table: `Queue`

```
+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| person_id   | int     |
| person_name | varchar |
| weight      | int     |
| turn        | int     |
+-------------+---------+
person_id is the primary key column for this table.
This table has the information about all people waiting for an elevator.
The person_id and turn columns will contain all numbers from 1 to n, where n is the number of rows in the table.
```

The maximum weight the elevator can hold is **1000**.

Write an SQL query to find the `person_name` of the last person who will fit in the elevator without exceeding the weight limit. It is guaranteed that the person who is first in the queue can fit in the elevator.

The query result format is in the following example:

```
Queue table
+-----------+-------------------+--------+------+
| person_id | person_name       | weight | turn |
+-----------+-------------------+--------+------+
| 5         | George Washington | 250    | 1    |
| 3         | John Adams        | 350    | 2    |
| 6         | Thomas Jefferson  | 400    | 3    |
| 2         | Will Johnliams    | 200    | 4    |
| 4         | Thomas Jefferson  | 175    | 5    |
| 1         | James Elephant    | 500    | 6    |
+-----------+-------------------+--------+------+

Result table
+-------------------+
| person_name       |
+-------------------+
| Thomas Jefferson  |
+-------------------+

Queue table is ordered by turn in the example for simplicity.
In the example George Washington(id 5), John Adams(id 3) and Thomas Jefferson(id 6) will enter the elevator as their weight sum is 250 + 350 + 400 = 1000.
Thomas Jefferson(id 6) is the last person to fit in the elevator because he has the last turn in these three people.
```

### Solution

`,` means `full join`
```sql
SELECT person_name
FROM (
    SELECT person_name,
           @accu := @accu + weight AS accu
    FROM
        (
            SELECT person_name, weight
            FROM   Queue
            ORDER  BY turn
        ) q,
        (
            SELECT @accu := 0
        ) vars
) t

WHERE  accu <= 1000
ORDER  BY accu DESC
LIMIT  1
```

repository: lek-tin/hashnopolis

branch_name: refs/heads/dev

gha_language: CSS

repo_name: lek-tin/hashnopolis


text:
# Express.js: Note Taker
![license](https://img.shields.io/badge/License-MIT-blue.svg)

## Description

This application called Note Taker can be used to write and save notes. This application uses an Express.js back end and saves and retrieve note data from a JSON file.

When the application is first opened the user is presented with a landing page with a link to a notes page. When the link is clicked on a new page is presented with existing notes on the left hand column and an empty field to create new notes on the righ hand column.

When a new note is entered into the text area, a save button appears. Once that save button is clicked the note is created and appears on the left hand column with the rest of the notes.

 The following technologies were used to create this application
  - Express.JS
  - Javascript
  - Heroku

Preview of final product
![Existing notes are listed in the left-hand column with empty fields on the right-hand side for the new note’s title and text.](./Assets/notetaker.png)

Live demonstration of the application can be found at https://guarded-temple-55964.herokuapp.com/

 ## Table of Contents

  - [Installation](#installation)
  - [Usage](#usage)
  - [License](#license)

  - [Resources](#resources)
  - [Questions](#questions)

 ## Installation
  To install the application clone the repository from GitHub. Ensure you have the necessary dependencies of Inquirer and Jest installed. To do so, invoke the command `npm install` in your terminal.

  You must also have Node.JS installed.

## Usage

  To run the application in your terminal invoke the command ``npm start``

  ## License
  [MIT](https://choosealicense.com/licenses/mit/)

  Copyright (c) 2021 Elise Harman

   ## Resources

  [Espress.JS Static Files](http://expressjs.com/en/starter/static-files.html)

  [fs.readFile](https://stackabuse.com/read-files-with-node-js/)

  [Heroku](https://devcenter.heroku.com/articles/deploying-nodejs)

  ## Questions
  If you have any questions or would like to report and issue please contact me at my [GitHub]( https://github.com/harmane4) or<EMAIL_ADDRESS>


text:
---
title: How to style your app/website in Statinamic
incomplete: true
---

## Future-proof & Local CSS

The default boilerplate contains 2 essentials things so you can easily write
CSS:

- [PostCSS](https://github.com/postcss/postcss),
a modular tool that allows you to use future-proof and custom CSS syntax
(by default, [postcss-cssnext](http://cssnext.io/) is enabled so you can use
a lot of new CSS things);
- [CSS modules](https://github.com/css-modules/css-modules),
which allows you to have local CSS classnames in your React components.

At first, you will probably found that not having global CSS is weird.
But the way the web and UI are evolving is clearly by following a component
approach. You should think about UI modules and style your components one by
one.

If you need some global CSS variables, [you can add some in the JavaScript
configuration](http://cssnext.io/usage/#features).
(but you should not use a lot).

**ProTip™**: For you layout, we advice you to use
[Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)
whenever you can.

_If you think this brief documentation is not enough, feel free to open an
issue._

### Why not inline styles instead of CSS?

Sadly, inline styles don't play well with pre rendering (at least yet).
When we build the static version, we don't know the device where we are going
to be displayed on, so viewport adjustments can't be done properly and will
result in some visual changes/rerendering.
You can probably provide a "not so bad" UX with a smooth re-rendering, but it's not an easy thing. If you think it easy, feel free to open an
issue to discuss about that!

repository: madx/statinamic

repo_name: madx/statinamic


text:
# loady

Dynamically load Python libraries, JSON and raw text from git repositories and
the web.

# Basic usage

    import loady

    # Permanently extend sys path with this github repo.
    loady.sys_path.extend('//git/github.com/timedata-org/simple'):

    # Temporarily extend sys path with this github repo.
    with loady.sys_path.extender('//git/github.com/timedata-org/simple'):
        # Do stuff.

    # Get raw data from URLs.
    result = loady.data.load(
        'https://github.com/timedata-org/simple/blob/master/simple.json')

    # Actually gets the raw data from this URL:
    # https://raw.githubusercontent.com/timedata-org/simple/master/simple.json
    # and reads it as JSON.

    #  Loads and compiles Python code from that URL.
    result = loady.code.load(
        'https://github.com/timedata-org/simple/blob/master/test.py')

repository: timedata-org/loady

repo_name: timedata-org/loady


text:
# C BYTE ORDERING

## sockaddr_in byte orders
sin_port and sin_addr members must have Network Byte Order designated

## Little Endian
low-order byte stored at addr (A), high-order byte stored on next addr (A + 1)

## Big Endian
high-order by stored at addr (A), low-order byte stored on next addr (A + 1)

## htons()
Host to Network Short
Converts 16 bit (2 bytes) from host byte order to network byte order

## htonl()
Host to Network Long
Converts 32 bit from host byte order to network byte order

## ntohl()
Network to Host Long
Converts 32 bit from network byte order to host byte order

## ntohs()
Network to Host Short
Converts 16 bit from network byte order to host byte order

repository: evanharmon/eph-headspace

repo_name: evanharmon/eph-headspace


text:
Laravel API/Scaffold/CRUD Generator (Laravel5)
=======================

Steps to Get Started
---------------------

1. Add this package to your composer.json:

        "require": {
            "aziz/laravel5-api-generator": "1.2.*"
        }

2. Run composer update

        composer update

3. Install dependency [aziz/smartmodel](https://github.com/azizgithub/ardent)

4. Read the documentation in the author https://github.com/mitulgolakiya/laravel-api-generator

repository: azizgithub/laravel-api-generator

repo_name: azizgithub/laravel-api-generator