curl -L https://github.com/nats-io/nats-server/releases/download/v2.10.12/nats-server-v2.10.12-darwin-amd64.zip -o nats-server.zip
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 Solution: | |
def removeElement(self, nums: List[int], val: int) -> int: | |
''' | |
while right pointer > left pointer | |
- check through from the right pointer | |
- move cursor to the left if the number there equals target | |
- else check through from the left pointer | |
- if number equals target, swap the left with the right | |
- move the left forward |
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 du -cksh .[!.]* * | sort -hr |
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 requests | |
import os | |
from urllib.parse import urlparse | |
import re | |
def process_markdown(markdown_file): | |
""" | |
Analyzes a markdown file, downloads images (current folder), and replaces URLs. | |
Args: |
SSH is an integral part of a software engineer's day to day activity. You can use SSH commands to connect to a remotely hosted machine over the internet or a local network. The normal way to connect to a machine is using this syntax:
ssh -i identityfile.pem username@hostname
You could also use a password. There's always a hassle to type this complete command, so you might want to abstract it to an alias in your ~/.bashrc or ~/.bash_profile file like this:
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 socket | |
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
server_socket.bind(('localhost', 80)) | |
server_socket.listen(1) | |
print('Server listening on port 80...') |