This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
This file contains 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
# Put this function to your .bashrc file. | |
# Usage: mv oldfilename | |
# If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
# Original mv is called when it's called with more than one argument. | |
# It's useful when you want to change just a few letters in a long name. | |
# | |
# Also see: | |
# - imv from renameutils | |
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |
This file contains 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
copyToClipboard(str) { | |
/* ——— Derived from: https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f | |
improved to add iOS device compatibility——— */ | |
const el = document.createElement('textarea'); // Create a <textarea> element | |
let storeContentEditable = el.contentEditable; | |
let storeReadOnly = el.readOnly; | |
el.value = str; // Set its value to the string that you want copied | |
el.contentEditable = true; |
This file contains 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
# use ImageMagick convert | |
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf | |
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf |
A lot of people run into the problem of running Let's Encrypt's CertBot Tool and an NGINX on the same container host. A big part of this has to do with CertBot needing either port 80 or 443 open for the tool to work as intended. This tends to conflict with NGINX as most people usually use port 80 (HTTP) or 443 (HTTPS) for their reverse proxy. Section 1 outlines how to configure NGINX to get this to work, and Section 2 is the Docker command to run CertBot.
I use Docker Compose (docker-compose) for my NGINX server. My docker-compose.yml file looks something like this:
This file contains 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
set remindersOpen to application "Reminders" is running | |
set monthAgo to (current date) - (30 * days) | |
tell application "Reminders" | |
set myLists to name of every list | |
repeat with thisList in myLists | |
tell list thisList | |
delete (every reminder whose completion date is less than monthAgo) | |
end tell | |
end repeat |
This file contains 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
... | |
... | |
providers: [ | |
{ provide: Http, useClass: ExtendedHttpService } | |
] | |
... | |
... |
This file contains 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 { NgFor } from '@angular/common' | |
import { Component, QueryList, TemplateRef, ViewChild, ViewChildren, ViewContainerRef } from '@angular/core' | |
@Component({ | |
directives: [ | |
NgFor | |
], | |
selector: 'component', | |
template: ` | |
<ul><li #item *ngFor="let number of list">{{number}}</li></ul> |
This file contains 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 that holds a read only property. | |
*/ | |
class PropertyBag { | |
/** | |
* Accessor. | |
* | |
* @return {string} | |
* The value. This annotation can be used for type hinting purposes. |
npm v3.10 - ◾
npm install -g npm
# Downgrade to a specific version
npm install -g npm@6
NewerOlder