See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
@Component({ | |
selector: 'app-my-content', | |
template: '<ng-container *ngTemplateOutlet="tplRef"></ng-container>', | |
}) | |
class MyContent { | |
@ContentChild('myContent', {static: true}) tplRef: TemplateRef<any>; | |
} |
const generateAccesskey = (method, password, ip, port) => { | |
const firstPart = btoa(`${method.toLowerCase()}:${password}`) | |
const secondPart = `${ip}:${port}` | |
const accesskey = `ss://${firstPart}@${secondPart}` | |
return accesskey | |
} |
## Must have sqlite3 installed. Homebrew user? brew install sqlite | |
## Can be ran directly in command line and will place file directory where ran | |
## Remove `-header` if you don't want the output to have the column name `item` | |
## Checkout more options and Workflow - https://github.com/T-Rave/alfred-clipboard-dump | |
# dumps output with list option since single column. Produces cleaner data without double quotes | |
sqlite3 -header -list ~/Library/Application\ Support/Alfred\ 3/Databases/clipboard.alfdb "SELECT item FROM clipboard;" > clipboard-dump.txt | |
# dumps full table to csv format | |
sqlite3 -header -csv ~/Library/Application\ Support/Alfred\ 3/Databases/clipboard.alfdb "SELECT * FROM clipboard;" > clipboard-dump.csv | |
# dumps only items in descending (inverse) order with no column name | |
sqlite3 -list ~/Library/Application\ Support/Alfred\ 3/Databases/clipboard.alfdb "SELECT item FROM clipboard ORDER BY item DESC;" > clipdump.txt |
dialog { | |
position: fixed; | |
top: 50%; | |
left: 50%; | |
right: auto; | |
padding: 30px; | |
transform: perspective(500px) translate(-50%, -50%); | |
background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF; | |
border: none; | |
border-radius: 3px; |
function createLoggedProxy(obj) { | |
var traps = {}; | |
for (let trap of Object.getOwnPropertyNames(Reflect)) { | |
traps[trap] = (...args) => { | |
console.log(trap, ...args.slice(0, -1)); // Last arg is always the proxy, no need to log it | |
return Reflect[trap](...args); | |
} | |
} | |
/* | |
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
It will generate several classes such as: | |
.m-r-10 which gives margin-right 10 pixels. | |
.m-r-15 gives MARGIN to the RIGHT 15 pixels. | |
.m-t-15 gives MARGIN to the TOP 15 pixels and so on. | |
.p-b-5 gives PADDING to the BOTTOM of 5 pixels | |
.p-l-40 gives PADDING to the LEFT of 40 pixels |
pure()
can be used as a higher order function or a decorator.
When passed a pure functional component, it wraps the function in a classful Component with a shouldComponentUpdate()
that ignores renders for unchanged props.
When passed a classful Component, it injects a shouldComponentUpdate()
method into the Component's prototype that ignores renders for unchanged props & state.
import pure from 'pure-component';