{
inner: "always" | "never" | "before" | "after"
outer: "always" | "never" | "before" | "after"
prefer: "inner" | "outer"
outerExceptions: "inCallExpressions" | "inNewExpressions" | "inArrayExpressions" | "inProperties" | "singleLine"
innerExceptions: "blocks" | "classes" | "switches"
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| "github.com/gorilla/websocket" | |
| ) | |
| var upgrader = websocket.Upgrader{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class FakeModel | |
| DataArray = [] | |
| class << self | |
| def arel_table; end | |
| def relation_delegate_class(_arg) | |
| MockRelationDelegate | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| var store = { | |
| _finishedUpdating () { | |
| this.listeners.forEach(listener => { | |
| var value = findInTree(state, listener.property) | |
| listener.callback(value) | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'rest_api_init', 'create_api_posts_meta_field' ); | |
| function create_api_posts_meta_field() { | |
| register_rest_field( 'post', 'custom_fields', array( | |
| 'get_callback' => 'get_post_meta_for_api', | |
| 'schema' => null, | |
| ) | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| journalctl -b -u service-name -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo find /tmp/ -iregex ".*\.\(tif?f\|png\|jpe?g\)" -delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # orig: osascript -e 'tell application "Google Chrome" to open location "\1"' | |
| osascript <<EOF | |
| tell application "Google Chrome" | |
| set activeIndex to get active tab index of window 1 | |
| tell window 1 | |
| set newTab to make new tab with properties {URL:"$1"} | |
| end tell | |
| set active tab index of window 1 to activeIndex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| go to line: | |
| :14 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # markdown to html link | |
| \[([^\]]+)]\(([^\)]+)\) | |
| <a href="\2">\1</a> | |
| # ruby old hash to new hash | |
| :([a-zA-Z_]+)(\s+)=> # trailing space | |
| \1:\2 |