Hi, I'm Miguel Mota.
A software developer from sunny Southern California. Learn more »

StackOverflow

Checkpoint git commit objects to Ethereum and verify using merkle proofs

In this guide we’ll go through creating a smart contract on Ethereum that notarizes git commits only if the commit date is within the allocated window of time and offer the ability to verify that a commit was published by verifying with merkle proofs composed from commit hash logs. Then we’ll be using git pre-push hooks to publish the commit on-chain on every tagged release. Here’s some schematics to help visualize the processes: Read more...

Migrating from Jekyll to Hugo

This post will go over how I migrated my Jekyll blog over to Hugo. Top reasons for moving to Hugo are: Faster compile time (it’s the fastest static site generator) Awesome documentation and community Go based templating (biased here) Dependency free (no dealing with ruby versions and gems) Robust theming support and content model Getting started First I created my hugo site: hugo new site mysite Then installed the blank theme: Read more...

Evolution of Blockchain Components to Off-Chain Models

The major components of blockchain are: Consensus Networking Record keeping Computation A blockchain is a shared state database that records outputs from transactions. The inputs for these computations are new inputs and current state from previously computed results. State transition updates are broadcasted via peer-to-peer networking and each node validates the incoming state updates to reach consensus. Blockchain brings the ability to execute programs in a trustless fashion by having every participating node in the network perform the computation and reach consensus on resulting output, where the output is then recorded into an immutable ledger. Read more...

How someone can take screen captures without you ever noticing

Sometimes I get paranoid about people hacking into my computer, and as a way to protect myself I try to think like them. I was wondering the other day how I can detect someone taking screen captures (screenshots) of my computer. After some experimenting, I’ve determined that it’s not so easy to detect this. This post will walk you though some of the ways I was able to take screen captures of my macOS computer without being easily detected (in the shoes of a “hacker”) as I was trying to figure some of the possible ways a hacker might go about it in order for me to try to detect such behavior. Read more...

Getting Started with Secure Scuttlebutt (SSB)

Scuttlebutt was started in May 2014 by Dominic Tarr (dominictarr) as an alternative offline-first invite-only social network that allows users to gain total control of their data and privacy. Secure Scuttlebutt (ssb) was released shortly after which puts privacy at the forefront with more encryption features. If you’re wondering where the heck the name Scuttlebutt came from: This 19th century term for a gossip comes from the nautical Scuttlebutt: “a barrel of water kept on deck, with a hole for a cup”. Read more...

Subtle Psychological Tricks

For focusing Chewing gum helps your brain focus. Blood flow is increased to the brain resulting in an improved ability to focus. Chewing gum while taking a test can help you concentrate better. Look from right to left when scanning a room to slow down search and find what you’re looking for. You’re most likely to miss things when scanning from left to right because your eyes are use to always looking in that direction. Read more...

How Unix programmers at restaurants search menus for their favorite plate

A Unix programmer heads over to the local diner to get something to eat for lunch. He, or Bob as he prefers, knows better than to manually scan the entire menu with his eyeballs because it’s inefficient. Bob knows that there’s a better way to automate the process in searching for what he wants to eat. Last time he was here he had a pretty good pasta-and-shrimp plate for under 10 bucks. Read more...

Introducing cointop – An interactive terminal app for tracking cryptocurrencies

cointop is a fast and lightweight interactive terminal based UI application for tracking and monitoring cryptocurrency coin stats in real-time. The interface is inspired by htop and shortcut keys are inspired by vim. Cointop in action Features Quick sort shortcuts Custom key bindings configuration Vim inspired shortcut keys Fast pagination Charts for coins and global market graphs Quick chart date range change Fuzzy searching for finding coins Currency conversion Save and view favorite coins Portfolio tracking of holdings 256-color support Custom colorschemes Help menu Offline cache Supports multiple coin stat APIs Works on macOS, Linux, and Windows It’s very lightweight; can be left running indefinitely Try it out brew install cointop For other platforms, check out the releases page or read the installation instructions in the README. Read more...

Getting Started with RxJS

RxJS is a JavaScript implementation of the Reactive Extensions (Rx), a model originally developed at Microsoft. RxJS is library that allows you to compose asynchronous and event-based programs using Observables. An Observable is similar to the Observer pattern where there is a Publisher and Subscriber. The Publisher emits values, and whoever is subscribed to it will receive them. In RX, the publisher is called the Observerable and the subscriber is called the Observer. Read more...

Exploring Decorators in JavaScript

In Object Oriented Programming, The Decorator Pattern is a popular design pattern that allows behavior to be added, removed, or modified from an object dynamically at runtime. In the latest iteration of the ES2016/ES7 specification, there is a proposal for JavaScript Decorators which lets us annotate and modify classes and properties at design time. I will be going over examples of decorators and how we can start using decorators in our code today. Read more...

Alexa Voice Service (AVS) Authentication

Here I am going to walk you through on how to retrieve an access token in order to be able to interact with the Alexa Voice Service by using cURL. I have been getting a lot of requests on how to do this step from people reading the Alexa Voice Service with cURL blog post. Set up AVS Device Type If you haven’t already, go into the Alexa Developer Console and register a new Device as Product Type: Read more...

Getting started with Service Workers

Service Workers enables the ability to cache files for offline use, serve as a network proxy, enable the ability for push notification, and even background data sync. AppCache was an attempt to solve this problem but it made many assumptions about intended uses and in the end just caused more fustration than anything, so it became deprecated. Service Workers is AppCache’s successor, which greatly superceeds it by giving the developer a lot more granular control. Read more...

Alexa Voice Service (AVS) with cURL

The Alexa Voice Service (AVS) is an Amazon service which lets you interact with Alexa by sending requests in audio format. This means that we can create our own Amazon Echo by just having a microphone and a speaker available. The easiest way to get started is with a hello world example using cURL. But before we jump to it cURL we have to generate our test audio first. Read more...

Set up Raspberry Pi as a Network Server

The Raspberry Pi has an infinite amount of uses and one of them is using it as a network server. This is handy because people in your home network can connect to this network server and access shared files, such as movies and music, which can be streamed to your TV. I will be going over how to set this up on a fresh RPi. Install Raspbian Raspbian is a light-weight Debian based Linux distro tailored for the RPi. Read more...

Summary of "Think and Grow Rich"

This past weekend I decided to read the book Think and Grow Rich by Napolean Hill. If you are not familiar with Hill, he interviewed hundreds of men with tremendous amounts of wealth, over the span of many years in the early 20th century, to figure out what it takes to bring in riches and fortunes. The findings of his research is what became the book. After reading it I must say that it is one of best books I have ever read in the sense that the value of the information presented is absolutely pricless. Read more...

Generate Self-signed SSL Certificate

Using HTTPS for your web application is a no-brainer, but sometimes it is not intuitively clear on how to get started on using SSL for your website. I’m going to be going over step-by-step on generating a self-signed certficate and testing it out on a Node.js web server. Generating Private Key First let’s generate a private key. The private key is used to decrypt the data encrypted by the public key. Read more...

K-Means Clustering in JavaScript

Clustering is grouping of data or dividing a large data set into smaller data sets of some similarity. A well known clustering algorithm in unsupervised machine learning is K-Means clustering. The K-Means algorithm takes in n observations (data points), and groups them into k clusters, where each observation belongs to a cluster based on the nearest mean (cluster centroid). The distance between a data point and cluster centroid is calculated using the Euclidean distance. Read more...

Naive Bayes Classifier in JavaScript

The Naive Bayes classifier is a pretty popular text classification algorithm because of it’s simplicity. You’ll often see this classifier used for spam detection, authorship attribution, gender authentication, determing whether a review is positive or negative, and even sentiment analysis. The Naive Bayes classifier takes in a corpus (body of text) known as a document, which then a stemmer runs through the document and returns a “bag or words” so to speak. Read more...

Pixelate images with Canvas

There may be cases in which you want to pixelate an image, such as creating 8-bit style pixel art themed games or you simply want to give a hint of what an image is about without exposing too much. Turns out that it’s not complicated at all to do pixelation with canvas. View demo » The main methods needed from the canvas context are imageSmoothingEnabled for rendering crisp pixels and drawImage for drawing those pixels on to the canvas context. Read more...

Bitwise operators in JavaScript

Bitwise operators act on the level of individual bits which allows for fast comparisons and calculations. I’ll be going over a couple of ways to use bitwise opeartors in JavaScript since it’s not entirely clear at first. Some of the examples shown are from various sources which I’ve accumlated over time in which I’m going to elaborate on them. Bitwise AND Return a one if the two bits are both one. Read more...

Subscribe

Receive updates on new posts.