If you mine your cryptocurrencies on your Mac using xmrig, here’s how you can automate it in such a way that it will run quietly in the background on boot-up. I use this set up to passively mine Dogecoin ($DOGE).

Note: this makes the assumption that your xmrig and config.json are all properly set up. If you need help with this, check out this amazingly helpful video tutorial on getting set up

For this we’re going to be leveraging launch agents. A launch agent is much like a launch daemon in that it runs programs as background processes — but…


If you’re a vi/vim fan like me, you‘re probably be aware of the .vimrc file (“vimrc” means “VIM Run Commands”). I inherited this file from my grad school advisor, and I’ve been carrying it with me for years now — adding things here and there. And now, I am sharing it with you

Copy the contents of this file into your .vimrc

version 6.3
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Text width set to 78
set textwidth=78
" Set the title string
set title
set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
" List chars
set lcs=tab:>-,trail:�
" Set no-compatible
set nocp
" Write…

At some point during an application’s development, you’ll eventually come across some data in a component that you will need to share with another component. In Angular, we can accomplish this multiple ways.

Scenario 1: Passing data from a parent component to its child

Assume we have two components: ParentComponent and ChildComponent, and we want the name variable to pass from parent to child. We can accomplish this by using either attribute bindings or by getting an instance of the component and updating the instance directly. Let’s start with attribute bindings.

We first define our custom binding attribute in the ChildComponent using the @Input() property:

import { Component, Input } from '@angular/core';@Component({ 
selector: 'app-child',
template: `name = ${name}`
})
export class ChildComponent {
@Input() name: string = '';}

We can now bind to this attribute directly in the html template in ParentComponent…


Note: This tutorial builds off of previous code that can be found here.

The repository for this project can be found on Github.

Now that we have a div that can be dragged around, let’s build in the elements to resize it. We want the div to be resizable on all sides, as well as each corner. To do that, we introduce 8 new elements (one for each side, and one for each corner).

frame.component.html

...<div class="resizers"
[style.width.px]="size.x"
[style.height.px]="size.y">
<div class="resizer right"></div>
<div class="resizer left"></div>
<div class="resizer bottom"></div>
<div class="resizer top"></div>
<div class="resizer top-right"></div>…

In this tutorial series I’m going to show you how to create an Angular component that can be dragged as well as resized by dragging its edge or corner.

The repository for this project can be found on Github

Let’s first define the component: I’m going to call it FrameComponent. This component will include both a div to act as a top-bar for dragging as well as a div to act as the resizer anchors.

frame.component.html

<div #wrapper class="frame-wrapper">
<div #topBar></div>
<div class="content-wrapper"></div>
<div class="resizers"></div>
</div>

frame.component.scss

.frame-wrapper {
position: absolute;
border: 2px solid black;
}
.content-wrapper {
position…

Chris Engelsma

Geophysicist, Software Engineer, Web Developer, Data Scientist

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store