-
- Robinhood: Bought beyond from my interdigital sales. Also sold seagate today.
- Ally: Cleared final holdings, microsoft and tesla. I’ll reup msft in robinhood.
- Paid rent while the money was moving around.
- It might be worth getting a stackoverflow account and starting to provide answers. The clout is a good bonus. Even better benefits: paying it forward + open source mentality.
- Brake fade is due to heat. Over long applications (braking all the way from like 200mph, or going downhill) the braking power decreases. Gas builds up.
- A strong thought I had today, and have had before: Convenience is the enemy of healthy eating, not flavor. It’s so much easier to grab a granola bar or cereal, a sandwich or snacks. Healthy foods are usually ingredients which require some sort of effort to transform from their raw state into a usual meal. This is what makes good nutrition difficult. We have enough distraction and exhaustion throughout the rest of our days; to add more in a neverending task like meal prep is hard.
- To fight against this, I do as much prep beforehand.
- My morning meals have always been a shake. Instead of getting out the teaspoons and measuring 10 different powders every morning, I do it in a batch of 10 jars. Then breakfast is just pouring a jar into water in a bottle.
- I have a veggie smoothie every day. Instead of cutting and apportioning all the kale and tyogurt and carrots and all every time, I batch it all at once. Then a smoothie is just grabbing 5 items from the fridge, rinsing with water, then throwing in a blender and drinking.
- Same goes for carrots/beets for juicing.
- Same goes for bell peppers for hummus/snacks.
- Abstract route logic into other functions, then have your route definitions (decorations) be as simple as possible. This is called route middleware: http://expressjs.com/2x/guide.html#route-middleware. The middleware can be responsible for looking up a user in the database, requiring that someone is an admin, or much more. Then once the middleware accomplishes what it wants, pass to next().
- Read through the express 4 api docs.
- app.use(path, callback)
- If nothing is passed to the first argument for path, it defaults to the home route /, so applies to everything.
- This is exactly where you put your middleware logic, and then mount it.
- Pretty similar to flask all around.
- Read through the mongoose 5 api docs, the mongo shim for node.
- All around similar to sqlalchemy. Define the schema, connect to the db, validate against models, etc.
- Worked with briley for a minute on the hydra angular frontend.
- npm:
- sudo chown -R $USER ~/.npm again.
- -D is the same as –save-dev
- Webpack:
- Pip.
- webpack.config.js provides mores configuration for the package, extending package.json. Both are similar to setup.py. The webpack config allows specification of entry points, resolvers, loaders, much more.
- Can also be used to build your client app or start development (webpack-dev-server).
- Defines the main template to load, the js to run on it (react render, etc).
- Simple MERN blog app:
- Created the client react app, refreshed on the express/mongo backend and server app. Compiled with webpack dev, almost done.
- Webpack config has the entry point defined, which is /src/index.js. This is like main. It loads react and all the components + stylesheets.
-
- Sick special model of the 2019 panigale v4 to honor the 25 year anniversary of the 916: https://www.ducati.com/us/en/bikes/panigale/panigale-v4-25-anniversario-916.
- Remember CORS = cross origin resource sharing.
- JS has a standard lib just like python, of course. For example, process.env.PATH is sys.path.
- === is strict equality, where it checks type and value. 3 == ‘3’ would return True but 3 === ‘3’ would not.
- Remember for permission denied errors, make sure you’re the owner. sudo chown -R $USER <path>
- Just like python, if you sudo npm i -g it’s going to install it into your system packages with root perms, so subsequent global installs without sudo will fail on permission issues.
- Stack overflow offline for maintenance a little today.
- MERN app.
- Express is pretty similar to flask. Instantiate an app, then add everything to it: models, routes, csrf, cors, session, whatever.
- Again, nodemon is the library to have an auto restarting express app. Just like flask debug=True and autoreloader=True.
- Kinda like blueprints, you can abstract all your views to another file using another package Router.
- .param is a way of specifying information about a request, kinda like running a preroute to look up info in the db and then attaching it to the g object in flask. The param itself is defined in a separate function and then any route can use it with :param.
- Remember .then and .catch for a function call (.catch = except: and .then = else: although you usually just put the after-success logic at the bottom of the try clause).
- RAID, parity bits, redundancy across drives.
- const { property_name } = obj is the syntax for destructuring in es6. You can redefine object attribute(s) to new variables.
-
- Remember that staticmethod and classmethod are the same in that they both operate on the class itself instead of an instance of the class, but a classmethod gets the class passed as an object so it can access other pieces of the class. A staticmethod receives no arguments.
- Wifiphisher can basically jam a network and present a user with a fake update screen where they have to reenter their password to reconnect. It then shows you the password. Social hacking!
- It was privacy badger, not adblockplus or ublock origin, that was prevented some of the image content on medium. Disabling it for those domains worked perfectly.
- Sold all my IDCC shares (interdigital, wireless company) at a loss. Once the funds are settle (can take up to 3 business days), I’ll turn it into BYND. I expect it to rise and fall just like btc, just I’ll ride it for about a week.
- Fasting has some interesting cleansing properties. When deprived of external sustenance, the body turns to itself for stores. This can benefit much: https://elemental.medium.com/why-fasting-diets-of-the-future-may-be-even-more-extreme-bf8db9befa70.
- IRS is going after a lot of crypto evasion: https://blog.cointracker.io/irs-sends-letter-6173-6174-6174-a-cryptocurrency-warnings-what-to-do/. I’m fine, I claimed all my losses (lol).
-
- React for bmahlstedt.com.
- Modified to use hooks instead of class syntax, added my images after making svg and transparent backgrounds.
- Read about how to serve a dockerized react app. Changed bmahlstedt.com to use this instead of my static flask app. https://github.com/brianmahlstedt/bmahlstedt.com/issues/1.
- That `serve` tool is pretty cool, but remember it’s for static sites. This is fine for bmahlstedt.com in its current state, but the supercontest would need node/express as the dynamic framework to serve it properly (can still use nginx and docker, node/express just replace flask).
- Remember, my nginx reverse proxy expects every prod container to serve its content on 8080. The dev container just forwards 5000 child to 5000 host.
- Had to restart the docker service because of that shimd issue. Had to rm the containers (kept the images, networks, and volumes), then docker-compose up on all of them.
- Added the react devtools extension to chrome.
- Productionized it. Set up a multistage docker build. First, it creates a container with my src and then builds a bundle with webpack from it (npm run build, which is built into create-react-app). Then, it copies the build output dir (and ONLY that) to a new container and serves it, deleting the intermediate previous container.
- React for southbaysupercontest.com.
- Trying to integrate react with an existing flask app.
- Did some exploration but decided that I don’t need to have react in the supercontest app at this moment.
- One thing I’m still not sure about. You can have react routes served with express. You can have content rendered and returned by flask. When you use them together, it seems to get a little gray. Why have two apps, two servers? I guess the more common case is that the react frontend is bundled then simply served by flask, rather than having two concurrent applications, one on frontend and one on backend.
- Remember, react router is the module that allows you to have multiple routes (in what would otherwise be a SPA). You can have separate bookmarkable urls within your domain.
- You can even have nested subroutes.
- Shareworks has had internal errors in serving documents (tax docs, shareholder notices, etc) for days now.
- YouTube started as a dating app lol.
- HN was pretty underwhelming this week.
- Python 3.8 comes with the walrus operator := which is a conditional assignment.
- Vectorization is almost required for web images. Looks so much cleaner unless the image is superrrrrr high resolution.
- “Github pages” is a pretty cool tool. You can serve static content directly from a repo. You can have a website built automatically from the react app or whatever is in the repo. https://help.github.com/en/articles/what-is-github-pages.
- The new corvette (c8) is actually sick. It doesn’t look like the classic corvettes, it’s much closer to a regular supercar frame. It is also allegedly selling for under 60k.
- Restarted the droplet for the first time (ever, I think).
- FYI, the letsencrypt docker composition I use for cert takes about 30 seconds once the containers are spun up for the first time until the certs are created and recognized.
- An Orioles OUTFIELDER pitched in the 16th inning of a 6 hour game and won it lol. He was throwing 50-60mph the whole time.
- Marshmallow is a python package that allows serialization/deserialization between complex datatypes (like full objects) and standard python datatypes. flask-marshmallow is a shim that allows use in the web framework, making it easier to hook up to sqlalchemy, etc.
- HATEOAS = hypermedia as the engine of application state.
-
- array.map(function) – apply the func to every element and return a new array with the values returned.
- array.filter(function) – this function should return a boolean based on a condition, and a whole new array is returned with only the original values that met the condition.
- Sim port attack: An attacker collects enough information about you (dob, etc) to convince your cell provider that they’re you. They then request that your sim card (your phone number) be transferred to a device they own. Since almost everyone uses their phone for 2FA, they then initiate a password reset for your google account (which is basically everyone’s main email). Once they have your google account, they can do a lot. Saved passwords, google auth with other sites, etc. They can issue bank transfers, empty your crypto accounts, etc.
- Jewish law is extremely strict. There are many activities which are not allowed on shabbat (friday evening to saturday night), which orthodox jew observe: https://en.wikipedia.org/wiki/Activities_prohibited_on_Shabbat.
- An example: you can’t carry things to other places. To get around this, orthodox jewish communities will construct a wire or fence around the district (an eruv). This means if you take an umbrella to a friend’s house, you’re not carrying it to another place, it’s all one private domain and you were just walking within it.
- Kosher(ing) salt is qualified by larger crystals because it is (was) used to extract the impurities (blood) from meat.
- Kosher does not mean it was blessed by a rabbi.
- For my smoking purposes, this larger crystal size just helps retain more water when rubbed on the meat.
- Trichinosis – disease caused by eating raw pork which contains trichinella (roundworms). These parasites die at 158F.
- Netflix is getting a lot of bad publicity lately. Disney+ is coming out, and Netflix is losing a lot of content. I still disagree with the media licensing regime in the first place. It’s going to become so fragmented.
- Good comparison of being a swe at amazon vs uber: https://medium.com/swlh/amazon-to-uber-from-the-lens-of-a-software-engineer-e5bd1c38caba. Neither jump out solely from this limited information.
- Rust is continuing to gain popularity. Syntactically like c++, but better at memory management.
- Tartiflette is a graphql server in python 3: https://tartiflette.io/.
- Remember, most uses of babel refer to the js compiler. But the flask library babel is for i18n l10n.
- Jon jones just got charged with battery from an incident with a stripper back in April. He allegedly slapped her.
- Every group of friends/coworkers/families has a “prestige economy” that drives actions. This is a popular concept in social science. For some, like common teenage male friend groups, it’s athletics or comedy. Decisions are made to increase fitness or humor. That’s what establishes the hierarchy in the group; that’s what earns brownie points among your peers. One that’s very popular among newer generations: virtue signaling. Showing some exhibition of justice to your friends, in an outward way.
- AT&T merged with Time Warner a while back. DirecTV prices have now increased instead of decreasing as promised. Many subscriptions were lost.
- Gatsby (https://www.gatsbyjs.org/) is kinda like create-react-app but it prerenders everything static beforehand, which means it’s faster (but can’t do dynamic stuff).
- Progressive web apps (PWAs) are mobile apps that are intentionally built to run in the browser. They’re html/css/js. They don’t need an app/play store to install, and they’re inherently cross-platform.
- Web
- sudo npm i -g npm@latest && sudo npm i -g npx@latest
- “serve” is a great npm package for running a static page. Just `serve -s <dir>` on a folder like the build output of create-react-app’s `npm run build`. You can also just run `npx serve` in that directory.
- react-scripts is a great package that gives the majority of standard commands (like those from pip or sx-setuptools) – start, build, test, etc.
- Played with create-react-app for quite a bit.
- Lol to apply a stylesheet in a react app, just import the css file into the js of the app. It’s not like html where you specify this sheet directly, but it does compile down to that.
- Goodnight y’all:
-

-
- Smoked 8 beef plate ribs yesterday. Bought some maple syrup and honey to experiment with the wrap drizzle. Used to just do brown sugar, wanna compare the bark glaze with the syrups.
- Honey was the winner.
- Gonna do the other 2 racks thursday for softball.
- Started to look for hawaii housing yesterday but jcriss had already booked. The hotel is $300/night. Searched for airbnbs nearby and there’s one right next door for $200/night. Booked it instead.
- Placed fresh order.
- Listened to joe rogan + sam harris in the background while working: https://www.youtube.com/watch?v=ZA106wrMUe4.
- Filed a claim for the equifax data breach. My data was part of the leak. $125 for compensation.
- Settled funds for Remy’s 30th in big bear.
- Cool site to find data breaches: https://haveibeenpwned.com/. Mine are 8tracks, dropbox, linkedin, eatstreet, exactis, ticketfly. I’m not worried about any. I don’t have password reuse accross any of those, nor do they contain particularly current or valuable data.
-
- Chores. Refilled jars. Laundry. Picked up chicken breast and beef ribs for smoking. Finally threw out the earring holder and reorganized the bedside table. Light grocery shopping.
- Deactivated my fb account. Never used it, and it was starting to fill with spam. Don’t need any extra exposure if I’m getting no value in return.
- Made homemade hummus. Used raw chickpeas and homemade roasted tahini. Delicious.
- Started the next kombucha batch as well.