Update app/vendor packages

This commit is contained in:
Rico Sta. Cruz 2018-07-09 10:21:46 +08:00
commit 8af730ebb3
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
28 changed files with 185 additions and 56 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
node_modules

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ _output
_site
.jekyll-metadata
/node_modules
/vendor

View File

@ -2,41 +2,38 @@
## Starting a local instance
This starts Jekyll and Webpack.
This starts Jekyll and Webpack. This requires recent versions of [Node.js], [Yarn], [Ruby] and [Bundler] installed.
```
```bash
yarn install
bundle install
env PORT=4001 yarn run dev
```
### Windows
[node.js]: https://nodejs.org/en/download/package-manager/
[ruby]: https://www.ruby-lang.org/en/documentation/installation/
[yarn]: https://yarnpkg.com/en/docs/install
[bundler]: https://bundler.io/
### Docker
You can also run a local instance using Docker. This is the preferred method, especially for Windows.
You only need to install Docker ([macOS](https://docs.docker.com/docker-for-mac/install/), [Windows](https://docs.docker.com/docker-for-windows/install/), [Ubuntu](https://docs.docker.com/install/linux/docker-ce/ubuntu/), [Arch Linux](https://www.archlinux.org/packages/community/x86_64/docker/), [other](https://www.docker.com/community-edition#download)).
First time setup:
1. Install **Ruby**: https://rubyinstaller.org/
* After the installation check the box and type `3` to select the 3rd option
* Add `C:\msys64\usr\bin` to PATH env variable
* Add `C:\Ruby24-x64\bin` to PATH env variable
2. Install **yarn**: https://yarnpkg.com/en/docs/install#windows
3. Install **jekyll** via command prompt: `gem install jekyll bundler`
4. Install **nodejs && npm**: https://nodejs.org/en/download/
4. Install **webpack** via command prompt: `npm install -g webpack`
5. If you have any issues after installing ruby, like `HOMEPATH` is not defined, then execute the below commands:
```bash
SETX HOMEDRIVE %SYSTEMDRIVE% -m
SETX HOMEPATH \Users\%username% -m
SET HOME=%SYSTEMDRIVE%\Users\%USERNAME%
SETX HOME "%HOME%"
# Build images (takes ~12mins)
docker-compose build
# First-time setup
docker-compose run --rm web bundle install
```
#### Start Jekyll and Webpack
Go wherever the project's files are located and open a new command prompt, execute the below commands:
Starting the server:
```bash
yarn install
bundle install
SET PORT=4001
yarn run dev
docker-compose up
```
## CSS classes

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM ruby:2.5.1-alpine3.7
RUN apk update && apk add --no-cache nodejs build-base
RUN apk add yarn --no-cache --repository http://dl-3.alpinelinux.org/alpine/v3.8/community/ --allow-untrusted
RUN mkdir -p /app
WORKDIR /app
# COPY Gemfile Gemfile.lock ./
# RUN bundle install -j 4
# COPY package.json yarn.lock ./
# RUN yarn

View File

@ -1,5 +1,6 @@
npmbin := ./node_modules/.bin
PORT ?= 3000
HOST ?= 127.0.0.1
# Builds intermediate files. Needs a _site built first though
update: _site critical
@ -23,9 +24,9 @@ dev-webpack:
dev-jekyll:
if [ -f _site ]; then \
bundle exec jekyll serve --safe --trace --drafts --watch --incremental --port $(PORT); \
bundle exec jekyll serve --safe --trace --drafts --watch --incremental --host $(HOST) --port $(PORT); \
else \
bundle exec jekyll serve --safe --trace --drafts --watch --port $(PORT); \
bundle exec jekyll serve --safe --trace --drafts --watch --host $(HOST) --port $(PORT); \
fi
test: _site

View File

@ -22,6 +22,8 @@ exclude:
- package-lock.json
- webpack.config.js
- node_modules
- Dockerfile
- docker_compose.yml
# Markdown

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -62,7 +62,7 @@ See: [Symbols view](https://atom.io/packages/symbols-view)
### Editing
| Shortcut | Decription
| Shortcut | Description
| --- | ---
| `⌘d` | Select word
| `⌘l` | Select line

View File

@ -76,7 +76,7 @@ The following classes modify the **font-size**
| `.is-size-6` | 1rem |
| `.is-size-7` | 0.75rem |
The following classes **allign** the text
The following classes **align** the text
| Class | Alignment |
| --- | --- |

View File

@ -115,6 +115,7 @@ expect(object)
.to.have.members([2, 3, 4])
.to.have.keys(['foo'])
.to.have.key('foo')
.to.have.lengthOf(3)
```
```js

View File

@ -37,7 +37,7 @@ Min Hour Day Mon Weekday
| `0 * * * *` | every hour |
| `*/15 * * * *` | every 15 mins |
| `0 */2 * * *` | every 2 hours |
| `0 0 0 * 0` | every Sunday midnight |
| `0 0 * * 0` | every Sunday midnight |
| --- | --- |
| `@reboot` | every reboot |

View File

@ -55,7 +55,7 @@ updated: 2017-09-20
```
```bash
-E, --ecrt <cert> # --ecrt: Client cert file
-E, --cert <cert> # --cert: Client cert file
--cert-type # der/pem/eng
-k, --insecure # for self-signed certs
```

View File

@ -94,7 +94,7 @@ divshot env:remove <env> KEY
divshot env:pull <env>
```
### App manangement
### App management
```
divshot create <appname>

View File

@ -4,7 +4,7 @@ category: Devops
layout: 2017/sheet
prism_languages: [yaml]
weight: -1
updated: 2018-03-17
updated: 2018-06-26
---
### Basic example
@ -46,60 +46,101 @@ docker-compose down
```
## Reference
{: .-one-column}
{: .-three-column}
### Building
```yaml
web:
# build from Dockerfile
build: .
```
```yaml
# build from custom Dockerfile
build:
context: ./dir
dockerfile: Dockerfile.dev
```
```yaml
# build from image
image: ubuntu
image: ubuntu:14.04
image: tutum/influxdb
image: example-registry:4000/postgresql
image: a4bc65fd
```
### Ports
```yaml
ports:
- "3000"
- "8000:80" # guest:host
```
```yaml
# expose ports to linked services (not to host)
expose: ["3000"]
```
### Commands
```yaml
# command to execute
command: bundle exec thin -p 3000
command: [bundle, exec, thin, -p, 3000]
```
```yaml
# override the entrypoint
entrypoint: /app/start.sh
entrypoint: [php, -d, vendor/bin/phpunit]
```
### Environment variables
```yaml
# environment vars
environment:
RACK_ENV: development
environment:
- RACK_ENV=development
```
```yaml
# environment vars from file
env_file: .env
env_file: [.env, .development.env]
```
# expose ports to linked services (not to host)
expose: ["3000"]
# make this service extend another
extends:
file: common.yml # optional
service: webapp
### Dependencies
```yaml
# makes the `db` service available as the hostname `database`
# (implies depends_on)
links:
- db:database
- redis
```
```yaml
# make sure `db` is alive before starting
depends_on:
- db
```
### Other options
```yaml
# make this service extend another
extends:
file: common.yml # optional
service: webapp
```
```yaml
volumes:
- /var/lib/mysql
- ./_data:/var/lib/mysql

14
docker-compose.yml Normal file
View File

@ -0,0 +1,14 @@
version: '3'
services:
web:
build: .
volumes:
- .:/app
- rubygems:/usr/local/bundle
ports:
- '4001:4001'
- '35729:35729'
command: 'env PORT=4001 HOST=0.0.0.0 yarn run dev'
volumes:
rubygems:

View File

@ -271,6 +271,9 @@ inspect(object, opts \\ [])
```elixir
value |> IO.inspect()
```
```elixir
value |> IO.inspect(label: "value")
```
## Numbers
@ -686,8 +689,8 @@ exp = ~r/hello/i
```elixir
~r/regexp/
~w(list of strings)
~s[strings with #{interpolation} and \x20 escape codes]
~S[no interpolation and no escapes]
~s|strings with #{interpolation} and \x20 escape codes|
~S|no interpolation and no escapes|
~c(charlist)
```

View File

@ -452,7 +452,7 @@ _| _| _|_|_| _| _| _| _|_|_| _|_|_| _| _|_|_| _|
```
{: .-figlet}
### caligraphy
### calligraphy
```
***** ** *

View File

@ -79,7 +79,7 @@ function play (song) {
See: <http://usejsdoc.org/tags-typedef.html>
### Other keywodrs
### Other keywords
```js
/**

View File

@ -1,6 +1,5 @@
---
title: Knex
category: Hidden
layout: 2017/sheet
updated: 2017-09-23
intro: |

6
osx.md
View File

@ -50,8 +50,8 @@ layout: 2017/sheet
- `networksetup` - Configure network (ip, dns, proxy, etc)
- `tmutils` - Configure Time Machine (enable/disable, exclude path, delete snapshots, etc)
- `mdutils` - Manage Spotlight (enable/disable, exclude, etc)
- `diskutil` - Controll disk (format, eject, unmount, etc)
- `launchctl` - Controll running "agents"
- `diskutil` - Control disk (format, eject, unmount, etc)
- `launchctl` - Control running "agents"
### Useful utils
@ -65,4 +65,4 @@ layout: 2017/sheet
- `/usr/libexec/airportd`
- `scutil`
__INFO: `brew` ([link](https://brew.sh)) is highly recomended utility__
__INFO: `brew` ([link](https://brew.sh)) is highly recommended utility__

54
pacman.md Normal file
View File

@ -0,0 +1,54 @@
---
title: Pacman
category: Linux
updated: 2018-07-07
intro: |
Pacman is the package manager for Arch linux and its derivatives.
---
## Commands
{: .-three-column}
### Common commands
| Command | Description |
| ----------------------- | --------------------------------- |
| `pacman -Syu <pkg>` | Install (and update package list) |
| `pacman -S <pkg>` | Install only |
| `pacman -Rsc <pkg>` | Uninstall |
| `pacman -Ss <keywords>` | Search |
| `pacman -Syu` | Upgrade everything |
{: .-prime}
### Query
| Command | Description |
| -------------------- | -------------------------------------- |
| `pacman -Qe` | List explictly-installed packages |
| --- | --- |
| `pacman -Ql <pkg>` | What files does this package have? |
| `pacman -Qii <pkg>` | List information on package |
| --- | --- |
| `pacman -Qo <file>` | Who owns this file? |
| --- | --- |
| `pacman -Qs <query>` | Search installed packages for keywords |
### Orphans
| Command | Description |
| ----------------------------- | --------------------------- |
| `pacman -Qdt` | List unneeded packages |
| `pacman -Rns $(pacman -Qdtq)` | Uninstall unneeded packages |
Avoid orphans by using `pacman -Rsc` to remove packages, which will remove unneeded dependencies.
### Other
| Command | Description |
| ------------------ | -------------------------- |
| `pactree <pkg>` | What does _pkg_ depend on? |
| `pactree -r <pkg>` | What depends on _pkg_? |
### References
* [Pacman tips and tricks](https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks) _(wiki.archlinux.org)_

View File

@ -23,7 +23,7 @@ $ pass insert [-m] twitter.com/rsc
$ pass generate [-n] twitter.com/rsc length
```
### Retreive
### Retrieve
``` bash
$ pass ls twitter.com/

2
pm2.md
View File

@ -26,7 +26,7 @@ updated: 2018-03-15
| `pm2 jlist` | Print process list in raw JSON |
| `pm2 prettylist` | Print process list in beautified JSON |
| --- | --- |
| `pm2 describe 0` | Display all informations about a specific process |
| `pm2 describe 0` | Display all information about a specific process |
| --- | --- |
| `pm2 monit` | Monitor all processes |

View File

@ -68,7 +68,7 @@ category: Rails
# Before/after filters
around_filter :wrap_in_transaction
def wrap_in_transaction(&blk)
ActiveRecord::Base.transation { yield }
ActiveRecord::Base.transaction { yield }
end
### HTTP basic authentication

View File

@ -505,7 +505,7 @@ Article.joins(:category, :comments)
```
```ruby
# Nested assocations
# Nested associations
Article.joins(comments: :guest)
```

View File

@ -40,7 +40,7 @@ npm install -D rollup
You may need to use `./node_modules/.bin/rollup` as a command if you did not install rollup globally.
### Mutiple outputs
### Multiple outputs
#### rollup.config.js
@ -106,7 +106,7 @@ import resolve from 'rollup-plugin-node-resolve'
export default {
input: 'src/main.js',
ouptut: {
output: {
file: 'bundle.js',
format: 'cjs'
},

8
vim.md
View File

@ -52,6 +52,12 @@ Getting started
| `$` | End of line |
{: .-shortcuts}
#### Character
| `fc` | Go forward to character `c` |
| `Fc` | Go backward to character `c` |
{: .-shortcuts}
#### Document
| Shortcut | Description |
@ -134,7 +140,7 @@ Operators
### Usage
{: .-prime}
Operators let you operate in a range of text (defined by *motion*). These are preformed in normal mode.
Operators let you operate in a range of text (defined by *motion*). These are performed in normal mode.
{: .-setup}
| `d` | `w` |