From 969967363febff067d64e1e935c66d4d33e3c346 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Fri, 3 Jul 2020 22:47:47 +1000 Subject: [PATCH] Formatting: update formatting of 20+ files (#1490) --- ansi.md | 63 +++++++++++++++++------------ atom.md | 95 +++++++++++++++++++++++--------------------- bookshelf-contrib.md | 21 ---------- cordova.md | 39 +++++++++++------- crypto.md | 9 ----- freenode.md | 24 ++++++++--- google-webfonts.md | 20 ++++++++-- imagemagick.md | 40 ++++++++++++------- jquery-cdn.md | 6 ++- nodejs-assert.md | 21 +++++++--- nodejs-path.md | 33 ++++++++++----- package.json | 1 + passenger.md | 21 ++++++---- premailer.md | 31 +++++++++++---- qunit.md | 53 +++++++++++++++--------- rails-gems.md | 24 ----------- ruby21.md | 34 +++++++++++----- rubygems.md | 43 ++++++++++++++------ siege.md | 25 +++++++++--- simple_form.md | 9 ++++- spreadsheet.md | 51 ++++++++++++++++-------- vim-easyalign.md | 36 +++++++++-------- weinre.md | 32 +++++++++++---- yarn.lock | 5 +++ znc.md | 46 ++++++++++++--------- 25 files changed, 478 insertions(+), 304 deletions(-) delete mode 100644 bookshelf-contrib.md delete mode 100644 crypto.md delete mode 100644 rails-gems.md diff --git a/ansi.md b/ansi.md index 3acfcc588c..a2d6fe7137 100644 --- a/ansi.md +++ b/ansi.md @@ -1,41 +1,52 @@ --- title: Ansi codes category: CLI +layout: 2017/sheet +intro: | + Quick reference to ANSI color codes. --- -Format +### Format - \033[#m +``` +\033[#m +``` -Where: +### ANSI codes - 0 clear - 1 bold - 4 underline - 5 blink +``` +0 clear +1 bold +4 underline +5 blink - 30-37 fg color - 40-47 bg color +30-37 fg color +40-47 bg color - 1K clear line (to beginning of line) - 2K clear line (entire line) - 2J clear screen - 0;0H move cursor to 0;0 +1K clear line (to beginning of line) +2K clear line (entire line) +2J clear screen +0;0H move cursor to 0;0 - 1A move up 1 line +1A move up 1 line +``` -Colors +### Colors - 0 black - 1 red - 2 green - 3 yellow - 4 blue - 5 magenta - 6 cyan - 7 white +``` +0 black +1 red +2 green +3 yellow +4 blue +5 magenta +6 cyan +7 white +``` -Stuff +### Bash utilities - hide_cursor() { printf "\e[?25l"; } - show_cursor() { printf "\e[?25h"; } +```sh +hide_cursor() { printf "\e[?25l"; } +show_cursor() { printf "\e[?25h"; } +``` diff --git a/atom.md b/atom.md index 8b95b4c1d6..72f83bec71 100644 --- a/atom.md +++ b/atom.md @@ -5,49 +5,52 @@ layout: 2017/sheet updated: 2017-09-20 --- -Shortcuts ---------- +## Shortcuts {: .-three-column} ### Tree -| Shortcut | Description | -| --- | --- | -| `⌘\` | Toggle tree | -| `⌘⇧\` | Reveal current file | +| Shortcut | Description | +| -------- | ------------------- | +| `⌘\` | Toggle tree | +| `⌘⇧\` | Reveal current file | {: .-shortcuts} ### Comments -| Shortcut | Description | -| --- | --- | -| `⌘/` | Toggle comments | +| Shortcut | Description | +| -------- | --------------- | +| `⌘/` | Toggle comments | {: .-shortcuts} ### View -| Shortcut | Description | -| --- | --- | +| Shortcut | Description | +| -------- | ---------------------- | | `⌘k` `←` | Split pane to the left | -| --- | --- | -| `⌘⌥=` | Grow pane | -| `⌘⌥-` | Shrink pane | -| --- | --- | -| `^⇧←` | Move tab to left | +| --- | --- | +| `⌘⌥=` | Grow pane | +| `⌘⌥-` | Shrink pane | +| --- | --- | +| `^⇧←` | Move tab to left | {: .-shortcuts} ### Bracket matcher -| `^m` | Go to matching bracket | -| `^]` | Remove brackets from selection | -| `^⌘m` | Select inside brackets | -| `⌥⌘.` | Close tag | +| Shortcut | Description | +| -------- | ------------------------------ | +| `^m` | Go to matching bracket | +| `^]` | Remove brackets from selection | +| `^⌘m` | Select inside brackets | +| `⌥⌘.` | Close tag | {: .-shortcuts} ### Symbols view -| `^⌥↓` | Jump to declaration under cursor | -| `^⇧r` | Show tags | +| Shortcut | Description | +| -------- | -------------------------------- | +| `^⌥↓` | Jump to declaration under cursor | +| `^⇧r` | Show tags | {: .-shortcuts} Symbols view enables Ctags support for Atom. @@ -62,34 +65,34 @@ See: [Symbols view](https://atom.io/packages/symbols-view) ### Editing -| Shortcut | Description -| --- | --- -| `⌘d` | Select word -| `⌘l` | Select line -| --- | --- -| `⌘↓` | Move line down -| `⌘↑` | Move line up -| --- | --- -| `⌘⏎` | New line below -| `⌘⇧⏎` | New line above -| --- | --- -| `⌘⇧k` | Delete line -| `⌘⇧d` | Duplicate line +| Shortcut | Description | +| -------- | -------------- | +| `⌘d` | Select word | +| `⌘l` | Select line | +| --- | --- | +| `⌘↓` | Move line down | +| `⌘↑` | Move line up | +| --- | --- | +| `⌘⏎` | New line below | +| `⌘⇧⏎` | New line above | +| --- | --- | +| `⌘⇧k` | Delete line | +| `⌘⇧d` | Duplicate line | {: .-shortcuts} ### Project -| Shortcut | Description -| --- | --- -| `⌘⇧p` | Command palette -| `⌘⇧a` | Add project folder -| --- | --- -| `⌘n` | New file -| `⌘⇧n` | New window -| --- | --- -| `⌘f` | Find in file -| `⌘⇧f` | Find in project -| `⌘t` | Search files in project +| Shortcut | Description | +| -------- | ----------------------- | +| `⌘⇧p` | Command palette | +| `⌘⇧a` | Add project folder | +| --- | --- | +| `⌘n` | New file | +| `⌘⇧n` | New window | +| --- | --- | +| `⌘f` | Find in file | +| `⌘⇧f` | Find in project | +| `⌘t` | Search files in project | {: .-shortcuts} ## Notes diff --git a/bookshelf-contrib.md b/bookshelf-contrib.md deleted file mode 100644 index b992fe2c06..0000000000 --- a/bookshelf-contrib.md +++ /dev/null @@ -1,21 +0,0 @@ -# bookshelf-contrib.Scopes -# -class Books - scopes: - published: (q) -> q.where(published: true) - -Books.published().fetchAll() - - -# bookshelf-contrib.QueryProxy -# -Books.query().where(published: true) -Books.where(published: true) - -# bookshelf-contrib.Migration -class Migration - up: -> - down: -> - - - diff --git a/cordova.md b/cordova.md index f95627ddaf..11d4d83dde 100644 --- a/cordova.md +++ b/cordova.md @@ -1,25 +1,34 @@ --- -title: Cordova +title: Apache Cordova +layout: 2017/sheet +intro: | + A quick reference to common [Apache Cordova](https://cordova.apache.org/) commands. --- - cordova plugin ls - cordova plugin search facebook - cordova plugin add com.phonegap.plugins.facebookconnect +### Common commands - cordova platform add ios - cordova platform ls - cordova platform update ios - cordova platform check +``` +cordova plugin ls +cordova plugin search facebook +cordova plugin add com.phonegap.plugins.facebookconnect +``` -### Some plugins +``` +cordova platform add ios +cordova platform ls +cordova platform update ios +cordova platform check +``` -You'll likely need these: +### Common plugins - * [org.apache.cordova.console](https://github.com/apache/cordova-plugin-console) - * [org.apache.cordova.inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser) - * [org.apache.cordova.statusbar](https://github.com/apache/cordova-plugin-statusbar) - * org.apache.cordova.splashscreen +Some commonly-used plugins: + +- [org.apache.cordova.console](https://github.com/apache/cordova-plugin-console) +- [org.apache.cordova.inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser) +- [org.apache.cordova.statusbar](https://github.com/apache/cordova-plugin-statusbar) +- org.apache.cordova.splashscreen Also: - * com.phonegap.plugins.facebookconnect +- com.phonegap.plugins.facebookconnect diff --git a/crypto.md b/crypto.md deleted file mode 100644 index 328f77e488..0000000000 --- a/crypto.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Cryptography ---- - - * [PBKDF2](http://en.wikipedia.org/wiki/PBKDF2) - password-based key derivation - function - - * [HMAC](http://en.wikipedia.org/wiki/HMAC) - Hash-based message authentication - code diff --git a/freenode.md b/freenode.md index e46f13296a..6dfb923584 100644 --- a/freenode.md +++ b/freenode.md @@ -1,14 +1,26 @@ --- title: Freenode +layout: 2017/sheet +tags: [WIP] --- -### irc.freenode.net +### IRC server - /msg nickserv identify [nick] - /msg nickserv info +``` +irc.freenode.net +``` + +### NickServ commands + +``` +/msg nickserv identify [nick] +/msg nickserv info +``` ### Add a nick - /nick newnick - /msg nickserv identify - /msg nickserv group +``` +/nick newnick +/msg nickserv identify +/msg nickserv group +``` diff --git a/google-webfonts.md b/google-webfonts.md index cc7a07df27..dbbcba3d7a 100644 --- a/google-webfonts.md +++ b/google-webfonts.md @@ -1,12 +1,26 @@ --- title: Google Webfonts +layout: 2017/sheet +intro: | + Short snippets on using [Google Webfonts](https://google.com/fonts) in a web page. --- ### Link tag - + +```html + +``` ### CSS import - @import url(http://fonts.googleapis.com/css?family=Open+Sans); - @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,400italic|Montserrat:400,700); + +```css +/* One font */ +@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700'); + +/* Combining multiple fonts */ +@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,400italic|Montserrat:400,700''); +``` + +Great for using with [Codepen.io](https://codepen.io/) or similar websites! diff --git a/imagemagick.md b/imagemagick.md index dd90a7eac3..cfbad766d7 100644 --- a/imagemagick.md +++ b/imagemagick.md @@ -1,31 +1,43 @@ --- title: Imagemagick +layout: 2017/sheet +intro: | + A quick reference for common [Imagemagick](https://www.imagemagick.org) commands and switches. --- -### Stuff +### Common options - -resize 100x40 - -crop 40x30+10+10 # (width)x(height)+(x)+y - -crop 40x30-10-10 # (width)x(height)+(x)+y - -flip # vertical - -flop # horizontal - -transpose # flip vertical + rotate 90deg - -transverse # flip horizontal + rotate 270deg - -trim # trim image edges - -rotate 90 +| Option | Description | +| ------------------- | ------------------------------- | +| `-resize 100x40` | Resize to a dimension | +| `-crop 40x30+10+10` | (width)x(height)+(x)+y | +| `-crop 40x30-10-10` | (width)x(height)+(x)+y | +| `-flip` | Vertical | +| `-flop` | Horizontal | +| `-transpose` | Flip vertical + rotate 90deg | +| `-transverse` | Flip horizontal + rotate 270deg | +| `-trim` | Trim image edges | +| `-rotate 90` | Rotate 90 degrees | ### Resize to fit - convert input.jpg -resize 80x80^ -gravity center -extent 80x80 icon.png +```sh +convert input.jpg -resize 80x80^ -gravity center -extent 80x80 icon.png +``` ### Convert all images to another format - mogrify -format jpg -quality 85 *.png +```sh +mogrify -format jpg -quality 85 *.png +``` ### Make a pdf - convert *.jpg hello.pdf +```sh +convert *.jpg hello.pdf +``` ### References - * http://www.noah.org/wiki/ImageMagick +- +- diff --git a/jquery-cdn.md b/jquery-cdn.md index f7fe9b52b5..6b892d0444 100644 --- a/jquery-cdn.md +++ b/jquery-cdn.md @@ -1,8 +1,12 @@ --- title: jQuery CDN category: JavaScript libraries +tags: [Archived] +layout: 2017/sheet --- ### Google jQuery - +```html + +``` diff --git a/nodejs-assert.md b/nodejs-assert.md index 0f86b98d15..e7a4fba706 100644 --- a/nodejs-assert.md +++ b/nodejs-assert.md @@ -1,16 +1,25 @@ --- title: assert category: Node.js +layout: 2017/sheet --- - assert(val) - assert.equal(actual, expected) - assert.notEqual(a, e) +### Assertions - assert.deepEqual(a, e) - assert.notDeepEqual(a, e) +```js +assert(val) +assert.equal(actual, expected) +assert.notEqual(a, e) +``` - assert.throws(fn) +```js +assert.deepEqual(a, e) +assert.notDeepEqual(a, e) +``` + +```js +assert.throws(fn) +``` ### References diff --git a/nodejs-path.md b/nodejs-path.md index ec8942e436..1a04038cae 100644 --- a/nodejs-path.md +++ b/nodejs-path.md @@ -1,18 +1,33 @@ --- -title: path +title: Node.js path API category: Node.js +layout: 2017/sheet +intro: | + Quick reference to the [Node.js path API](https://nodejs.org/api/path.html). --- - fs.realpath('/etc/passwd', function(err, path) { /* "/private/etc/passwd" */ - }); +### Functions - dir = path.join('etc', 'passwd'); - dir = path.resolve('/etc', 'passwd', '..', 'var'); +```js +const fs = require('fs') - path.dirname('/etc/passwd') //=> "/etc" - path.basename('/etc/passwd') //=> "passwd" - path.basename('/etc/rc.d', '.d') //=> "rc" +fs.realpath('/etc/passwd', function (err, path) { + path // => "/private/etc/passwd" +}) +``` + +```js +const path = require('path') +dir = path.join('etc', 'passwd') +dir = path.resolve('/etc', 'passwd', '..', 'var') +``` + +```js +path.dirname('/etc/passwd') // => "/etc" +path.basename('/etc/passwd') // => "passwd" +path.basename('/etc/rc.d', '.d') // => "rc" +``` ### References -- http://nodejs.org/api/path.html +- https://nodejs.org/api/path.html diff --git a/package.json b/package.json index 627ced39af..ddbd9f4d71 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "devDependencies": { "@babel/core": "^7.10.2", "@babel/preset-env": "^7.10.2", + "@rstacruz/prettier-plugin-markdown-code-fences": "^1.0.0", "jest": "26.0.1", "jest-html": "1.5.0", "netlify-plugin-minify-html": "^0.2.3", diff --git a/passenger.md b/passenger.md index 055b5b1e77..9d7fe863d6 100644 --- a/passenger.md +++ b/passenger.md @@ -1,12 +1,19 @@ --- title: Phusion Passenger +tags: [WIP] +layout: 2017/sheet --- - server { - listen 80; - server_name www.yourhost.com; - root /somewhere/public; # <--- be sure to point to 'public'! - passenger_enabled on; - autoindex on; # Show directory listings - } +### Enabling Phusion passenger +``` +server { + listen 80; + server_name www.yourhost.com; + root /somewhere/public; # <--- be sure to point to 'public'! + passenger_enabled on; + autoindex on; # Show directory listings +} +``` + +This is an example nginx configuration. diff --git a/premailer.md b/premailer.md index d1b79a06ed..eed4fb81ca 100644 --- a/premailer.md +++ b/premailer.md @@ -1,13 +1,28 @@ --- title: Premailer +layout: 2017/sheet +tags: [WIP] +intro: | + [Premailer](https://github.com/premailer/premailer/) is a Ruby library that inlines CSS into HTML. --- +### Custom CSS properties - -premailer-width - Available on table, th and td elements - -premailer-height - Available on table, tr, th and td elements - -premailer-cellpadding - Available on table elements - -premailer-cellspacing - Available on table elements + +```css +table, th, td { + /* Available on table, th and td elements */ + -premailer-width: 32px; +} + +table, tr, th, td { + /* Available on table, tr, th and td elements */ + -premailer-height: 32px; +} + +table { + /* Available on table elements */ + -premailer-cellpadding: 32px; + -premailer-cellspacing: 32px; +} +``` diff --git a/qunit.md b/qunit.md index be7008e7f4..f5a47bb4c6 100644 --- a/qunit.md +++ b/qunit.md @@ -1,32 +1,47 @@ --- title: Qunit category: JavaScript libraries +layout: 2017/sheet +intro: | + A quick reference for the [QUnit](https://yarnpkg.com/package/qunit) testing library in JavaScript. --- - QUnit.module('a'); - QUnit.test('ok', function (t) { ... }); +```js +QUnit.module('a') +QUnit.test('ok', function (t) { + /* ... */ +}) +``` ### Hooks - // each test - QUnit.testStart(function) - QUnit.testEnd(function) +#### Each test - // each module - QUnit.moduleStart(function) - QUnit.moduleEnd(function) +```js +// each test +QUnit.testStart(function) +QUnit.testEnd(function) +``` - // all - QUnit.begin(function) - QUnit.done(function) +```js +// each module +QUnit.moduleStart(function) +QUnit.moduleEnd(function) +``` -### Assertions - - t.equal(actual, expected) - t.deepEqual(actual, expected) - t.strictEqual(actual, expected) - t.propEqual(actual, expected) +```js +// all +QUnit.begin(function) +QUnit.done(function) +``` - t.notEqual +### Assertions - t.expect(amount) +```js +t.equal(actual, expected) +t.deepEqual(actual, expected) +t.strictEqual(actual, expected) +t.propEqual(actual, expected) +t.notEqual(actual, expected) +t.expect(amount) +``` diff --git a/rails-gems.md b/rails-gems.md deleted file mode 100644 index aedaf4a6ff..0000000000 --- a/rails-gems.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: Rails gems -category: Rails ---- - -### Rico's preferred rails gems - -Development: - - gem 'spring' # code reloading - gem 'letter_opener' - gem 'better_errors' - gem 'meta-tags' - gem 'guard-rspec' - -Prod: - - gem 'kaminari' # pagination - gem 'devise' - gem 'meta-tags', require: 'meta_tags' - gem 'friendly_id' - gem 'bourbon' - gem 'neat' - gem 'turbolinks' diff --git a/ruby21.md b/ruby21.md index fe3b231ede..76660ce991 100644 --- a/ruby21.md +++ b/ruby21.md @@ -1,25 +1,37 @@ --- title: Ruby 2.1 category: Ruby +layout: 2017/sheet +tags: [Archived] +intro: | + Quick reference to the [new features in Ruby 2.1](https://www.ruby-lang.org/). --- ### Named arguments with defaults - # length is required - def pad(num, length:, char: "0") - num.to_s.rjust(length, char) - end +```ruby +# length is required +def pad(num, length:, char: "0") + num.to_s.rjust(length, char) +end +``` - pad(42, length: 6) #=> "000042" - pad(42) #=> # +```ruby +pad(42, length: 6) #=> "000042" +pad(42) #=> # +``` ### Module.prepend - prepend(Module.new do - define_method ... - end) +```ruby +prepend( + Module.new do + define_method ... + end +) +``` ### References - * http://globaldev.co.uk/2013/03/ruby-2-0-0-in-detail - * http://globaldev.co.uk/2014/05/ruby-2-1-in-detail +- http://globaldev.co.uk/2013/03/ruby-2-0-0-in-detail +- http://globaldev.co.uk/2014/05/ruby-2-1-in-detail diff --git a/rubygems.md b/rubygems.md index 48a4f970ef..2bd640dc1e 100644 --- a/rubygems.md +++ b/rubygems.md @@ -1,21 +1,40 @@ --- title: Rubygems category: Ruby +layout: 2017/sheet +intro: | + A quick reference to common [rubygems](https://rubygems.org) CLI commands. --- - gem build *.gemspec # Build a gem - gem install *.gem # Install locally - gem push *.gem # Upload to rubygems.org - gem yank foogem -v 0.0.1 # Take it back +### Building and publishing - gem owner foogem -a rico@ricostacruz.com +```sh +gem build *.gemspec # Build a gem +gem install *.gem # Install locally +gem push *.gem # Upload to rubygems.org +gem yank foogem -v 0.0.1 # Take it back +``` - gem list # List local gems - gem which rake # Point to where lib/rake.rb is - gem search -r rails # [remote] Search for gems +### Querying - # https://github.com/fnando/gem-open - gem open foogem - GEM_EDITOR="vim" gem open foogem +```sh +gem owner foogem -a rico@ricostacruz.com - cd $(basename `gem which rake`) # Go to a gem's path +gem list # List local gems +gem which rake # Point to where lib/rake.rb is +gem search -r rails # [remote] Search for gems +``` + +### Opening a gem + +```sh +# https://github.com/fnando/gem-open +gem open foogem +GEM_EDITOR="vim" gem open foogem +``` + +### Changing to a directory + +```sh +cd $(basename `gem which rake`) # Go to a gem's path +``` diff --git a/siege.md b/siege.md index 2422d93be9..d2e6b10b2b 100644 --- a/siege.md +++ b/siege.md @@ -1,11 +1,20 @@ --- title: Siege category: Others +layout: 2017/sheet +intro: | + [Siege](https://www.joedog.org/siege-home/) is an HTTP and HTTPS load testing tool. --- +### Basic usage + +```sh +siege -b -c=10 -t=5m "http://..." ``` -siege -b -c=10 -t=5m http://... -``` + +### Options + +#### Repetitions ``` -c, --concurrent=N @@ -13,24 +22,28 @@ siege -b -c=10 -t=5m http://... -r, --reps=N ``` +#### Modes + ``` -i, --internet Hit URLs randomly -b, --benchmark No delay between requests ``` -### Configuration +#### Configuration ``` -f, --file=FILE load urls.txt -R, --rc=FILE load siegerc ``` -> Also see: [siegerc](https://gist.github.com/stansmet/3067988) - -### Headers +#### Headers ``` -H, --header="Cookie: foo=bar" -A, --user-agent="Mozilla" -T, --content-type="text/html" ``` + +### References + +Also see: [siegerc](https://gist.github.com/stansmet/3067988) diff --git a/simple_form.md b/simple_form.md index 2a61867dcc..1013070cec 100644 --- a/simple_form.md +++ b/simple_form.md @@ -1,7 +1,11 @@ --- title: SimpleForm +layout: 2017/sheet +tags: [WIP] --- +### Inputs + ```ruby <%= f.input :email, required: false, autofocus: true %> <%= f.input :password, required: false %> @@ -9,7 +13,8 @@ title: SimpleForm <%= f.button :submit, "Sign in" %> ``` +### Adding a wrapper + ```ruby -simple_form_for @x, - wrapper: :small +simple_form_for @x, wrapper: :small ``` diff --git a/spreadsheet.md b/spreadsheet.md index 8f670c2f38..3e5898322b 100644 --- a/spreadsheet.md +++ b/spreadsheet.md @@ -1,35 +1,54 @@ --- title: Spreadsheet functions +tags: [WIP] +layout: 2017/sheet --- ### If - =IF(test, then, else) - =IF(EQ(A1, "paid"), "true", "false") +``` +=IF(test, then, else) +=IF(EQ(A1, "paid"), "true", "false") +``` ### Comparators - =EQ(a,b) NE() - =GT() GTE() LT() LTE() - +``` +=EQ(a,b) +=NE(a,b) +=GT(a,b) +=GTE(a,b) +=LT(a,b) +=LTE(a,b) +``` + ### Math - =POW(2, 32) # 2^32 - =SIN() ACOS() etc - =CEILING(n,sig,mode) - =FLOOR(n,sig,mode) - =INT(n) +``` +=POW(2, 32) # 2^32 +=SIN() ACOS() etc +=CEILING(n,sig,mode) +=FLOOR(n,sig,mode) +=INT(n) +``` - =SUM(range) +``` +=SUM(range) +``` - =SUMIF(range, criteria, sum_range) - =SUMIF(A1:A5, ">300", B1:B5) # if A# is >300, use B# +``` +=SUMIF(range, criteria, sum_range) +=SUMIF(A1:A5, ">300", B1:B5) # if A# is >300, use B# +``` ### Core - =TO_DATE(number) +``` +=TO_DATE(number) +``` ### Vlook - =VLOOKUP(value, range, column_index) - +``` +=VLOOKUP(value, range, column_index) +``` diff --git a/vim-easyalign.md b/vim-easyalign.md index f34a782507..daf66882bc 100644 --- a/vim-easyalign.md +++ b/vim-easyalign.md @@ -54,14 +54,18 @@ category: Vim ### `:EasyAlign = dr` (delimiter_align right) - apple = 1 - banana += apple - cake ||= banana +``` +apple = 1 +banana += apple +cake ||= banana +``` ### `:EasyAlign :` (for json or yaml) - url: jdbc:mysql://localhost/test - database: test +``` +url: jdbc:mysql://localhost/test +database: test +``` ### `:EasyAlign *|` (markdown tables) @@ -71,10 +75,9 @@ category: Vim | `2` | on 2nd occurrence (and so on) | ``` -Interactive mode ----------------- +## Interactive mode -| `{Visual}` `⏎` | activate for selection | +| `{Visual}` `⏎` | activate for selection | | `ga` `{motion}` | activate for motion/text object | {:.greycode} @@ -82,19 +85,18 @@ Then press options (if available), then a delimiter. ### Interactive mode options -| `⏎` | Set `alignment` | +| `⏎` | Set `alignment` | | `` `4 ⏎` | Set `left_margin` (to the left of the delimiter) | -| `` `4 ⏎` | Set `right_margin` | -| `↓` | no margin | +| `` `4 ⏎` | Set `right_margin` | +| `↓` | no margin | {:.greycode} ### Example - * `gaip` `` `8⏎` `=` - puts 8 spaces before the equal sign +- `gaip` `` `8⏎` `=` - puts 8 spaces before the equal sign -Also see --------- +## Also see -* [vim-easy-align](https://github.com/junegunn/vim-easy-align) -* [Examples](https://github.com/junegunn/vim-easy-align#examples) -* [Alignment options](https://github.com/junegunn/vim-easy-align#alignment-options) +- [vim-easy-align](https://github.com/junegunn/vim-easy-align) +- [Examples](https://github.com/junegunn/vim-easy-align#examples) +- [Alignment options](https://github.com/junegunn/vim-easy-align#alignment-options) diff --git a/weinre.md b/weinre.md index 9ed4147e50..5560615c07 100644 --- a/weinre.md +++ b/weinre.md @@ -1,17 +1,35 @@ --- title: Weinre category: JavaScript libraries +layout: 2017/sheet +tags: [Archived] +intro: | + [weinre](https://www.npmjs.com/package/weinre) is a remote Web inspector. Note that it has been deprecated since 2016. --- - * [Weinre](http://people.apache.org/~pmuellr/weinre/) +### Usage -Install: +#### Install: - $ npm install -g weinre +``` +$ npm install -g weinre +``` -Start the server: +#### Start the server: - $ weinre --boundHost 0.0.0.0 - $ open http://localhost:8080 +``` +$ weinre --boundHost 0.0.0.0 +$ open http://localhost:8080 +``` + +### HTML to inject + + +```html + +``` + +### References + +- [Weinre](http://people.apache.org/~pmuellr/weinre/) - diff --git a/yarn.lock b/yarn.lock index 0901fe14a4..c43d196151 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1170,6 +1170,11 @@ "@parcel/utils" "^1.11.0" physical-cpu-count "^2.0.0" +"@rstacruz/prettier-plugin-markdown-code-fences@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@rstacruz/prettier-plugin-markdown-code-fences/-/prettier-plugin-markdown-code-fences-1.0.0.tgz#b432eed2db4726abe2c3efaa75c12322976a8ab6" + integrity sha512-p/P6BH6tGoCbgMemimUIXJSwi5enZ/HhLupATlPqJmjal00gociP1lbbUQEs97PWjLsgmY3kKu30yKzMSIs0mA== + "@sinonjs/commons@^1.7.0": version "1.8.0" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.0.tgz#c8d68821a854c555bba172f3b06959a0039b236d" diff --git a/znc.md b/znc.md index eb7d1405f8..ad2bcdaf56 100644 --- a/znc.md +++ b/znc.md @@ -1,32 +1,40 @@ --- title: ZNC bouncer +layout: 2017/sheet +intro: | + A quick reference to the [ZNC](https://znc.bg) IRC bouncer's common commands. --- ## Start - /msg *status addserver irc.undernet.org [6667] - /msg *status connect +``` +/msg *status addserver irc.undernet.org [6667] +/msg *status connect - /msg *status loadmod webadmin - /msg *status loadmod admin - /msg *status loadmod away - /msg *status loadmod awaynick - /msg *status loadmod clientnotify # Notifies when another client logs - /msg *status loadmod keepnick - /msg *status loadmod kickrejoin +/msg *status loadmod webadmin +/msg *status loadmod admin +/msg *status loadmod away +/msg *status loadmod awaynick +/msg *status loadmod clientnotify # Notifies when another client logs +/msg *status loadmod keepnick +/msg *status loadmod kickrejoin +``` ## Away - /msg *status loadmod away - /msg *away away - /msg *away back - /msg *away show #=> Show messages - /msg *away delete all +``` +/msg *status loadmod away +/msg *away away +/msg *away back +/msg *away show #=> Show messages +/msg *away delete all +``` ## Watch - /msg *status loadmod watch - /msg *watch list - /msg *watch add * *watch *rico* - /msg *watch add * *watch *%nick%* - +``` +/msg *status loadmod watch +/msg *watch list +/msg *watch add * *watch *rico* +/msg *watch add * *watch *%nick%* +```