Monthly Archives

9 Articles

Best Plugins for JavaScript development in Vim

JavaScript development in Vim

Are you doing JavaScript development in Vim? Are you struggling to get setup with the right plugins? I’ll share the plugins I’m using with you. I’ll group them so you know which are Javascript/ Typescript specific, and which are just general developer plugins that I like. If you have some plugins that you really like and you don’t see them here, let me know in the comments 🙂

I’m a big vim+tmux fan, so I’ll probably do another post about how I have my stuff setup! Thanks for reading! Checkout the video if you want to see the plugins in action.

Github link

 

JavaScript Plugins

Plugin ‘othree/javascript-libraries-syntax.vim’
“more javascript syntax

Plugin ‘ruanyl/vim-fixmyjs’
” autofix eslint errors

Plugin ‘jelera/vim-javascript-syntax’
” syntax highlighting 5/5

Plugin ‘flowtype/vim-flow’
” flow typings

Plugin ‘leafgarland/typescript-vim’
” syntax for typescript

Plugin ‘moll/vim-node’
” gf to open files from require and imports 5/5

Plugin ‘mtscout6/syntastic-local-eslint.vim’
” gets eslint to use the local version of eslint in a project

Plugin ‘marijnh/tern_for_vim’
” Autocomplete / symbol renaming

Plugin ‘Quramy/tsuquyomi’
” rename symbols, lookup, imports etc

General Developer Plugins

Plugin ‘VundleVim/Vundle.vim’
” plugin manager

Plugin ‘Valloric/YouCompleteMe’
” autocomplete 5/5

Plugin ‘scrooloose/nerdtree’
” file browsing 5/5

Plugin ‘mileszs/ack.vim’
” searching

Plugin ‘ctrlpvim/ctrlp.vim’
” find files 5/5

Plugin ‘tpope/vim-surround’
” surround with tags or blocks 5/5

Plugin ‘tpope/vim-fugitive’
” git integration 5/5

Plugin ‘scrooloose/nerdcommenter’
” comment out in multiple languages 5/5

Plugin ‘scrooloose/syntastic’
” syntax checking 5/5

Plugin ‘editorconfig/editorconfig-vim’
” editor style rules 5/5

Plugin ‘Shougo/vimproc.vim’
” async vim commands

Plugin ‘vim-scripts/marvim’
” macro manager

Plugin ‘mbbill/undotree’
” visual undo history

Plugin ‘SirVer/ultisnips’
” snippet manager

Plugin ‘honza/vim-snippets’
” bunches of snippets

Plugin ‘tpope/vim-repeat’
” makes the vim repeat option handle more complex things

Plugin ‘terryma/vim-multiple-cursors’
” type in multiple places

Plugin ‘Chiel92/vim-autoformat’
” Autoformat 5/5

Visual alterations

Plugin ‘vim-scripts/ShowMarks’
” shows where your marks are

Plugin ‘altercation/vim-colors-solarized’
” dope colorscheme

Plugin ‘vim-airline/vim-airline-themes’
” themes for airline

Plugin ‘edkolev/tmuxline.vim’
” tmux statusline generator

Plugin ‘christoomey/vim-tmux-navigator’
” seamless tmux navigation

Plugin ‘vim-airline/vim-airline’
” airline indicators

Plugin ‘edkolev/promptline.vim’
” more airline related stuff

Software ideas – Ideas of the day

by Micah Riggan 0 Comments

3 software ideas:

I had a couple of software ideas today. I listened to a Software Engineering Daily podcast that was about developers making money from their side projects, so I think that influenced me. Link for those interested. This is a part of an ongoing series where I try and come up with 3 ideas per day. This exercise stimulates creativity and is fun and often more challenging than I expect. Let me know what you think of these ideas in the comment section below 🙂

software ideas - ideas of the day

software ideas – ideas of the day

botdot

  • This is a programming game. Sort of like lightbot, but 2D and with the goal of teaching functions
  • Use functions to move a dot to it’s goal
  • functions can move dot up down left right
  • functions can also split the dot, for puzzles where multiple dots must be used
  • all dots must be on their corresponding destinations for the level to be beaten

DoMore

  • This is an app that helps you work on your main focus areas.
  • Users list what they’d like to focus more on life
  • the app walks the users through picking blocks of time where they could potentially focus on something
  • app suggests that you work on one of your focus areas during your blocks of free time
  • app has triggers and integrations to detect when you are doing your focus activity
  • app connects you with others who are trying to do more of what you’re trying to do more of

StackTest

  • Tests your familiarity with the basics of a given software development stack.
  • Asks you to answer questions or provide code snippets to accomplish basic tasks for a given stack.
  • Times your responses and runs code against unit tests.
  • Statistics are generated so that you can see your proficiency in a stack, and find things you need to work on.

 

 

 

3 ideas of the day – the challenge increases

by Micah Riggan 0 Comments

Back at it again with the ideas of the day

Back at it again with the ideas of the day

Back at it again with the ideas of the day

I said I was going to try to do 3 ideas per day. I’m not sure how many days I’ll be able to keep this up for. I managed to think up of some pretty decent ones this time, but it was tough. I had a lot of fun thinking of these! Hopefully you have just as much fun reading my 3 ideas of the day!

Let me know what you think in the comments or on twitter/fb 🙂

Drone seeding and watering

  • Drone comes equipped with a “dock to refill container” and a sprayer
  • The sprayer is used to spray seeds or water out
  • Drone files to seed bin and fills up container with seeds
  • Drone plants seeds and records where it plants them
  • Drone flies to water bin and fills up container with water
  • Drone routinely flies and checks plants for dryness
  • If the plant needs water then the drone applies water to it

Knot sensing back massager

  • Massager builds a topological map of your back
  • Massager connects to smart phone
  • You can mark painful areas of the map on your phone
  • Massager uses optimal vibration pattern given the size and place of the knot, taking into account user preferences
  • Mobile app is used to recommend stretches that help the areas.
  • Option to send the map to your chiropractor for visit scheduling / advice

Smart water bottle

  • Bottle has Bluetooth connection and level sensor
  • mobile app connects to water bottle.
  • notifies you every 5 minutes that the bottle is empty
    • allow user to configure a time window this setting is active
  • provides drinking statistics for sharing and comparing
  • Warns you when you’re not drinking enough water

How to automate development environment setup and why you should

When should you automate development environment setup?

Have you ever started to build something on your personal machine and found that you’re missing one of your dev tools? Maybe you’ve started working at a new company and spent days getting your machine setup with the proper tools and configuration that you like? Scripting your development environment setup can help you get setup quickly on new machines, or keep your tools synced across multiple machines.

If you’re in charge of building machines for developers, I strongly recommend implementing this in some form. Design a process for building machines preloaded with developer settings and programs. Perhaps a company wide settings build, with each developer team building a script for new hires. This will save your company a lot of time and money.

I’m a big fan of automating your dev environment setup. Hopefully you see the benefits of it as well.

Personal Machine – Starting fresh

Starting fresh! automate development environment

Starting fresh! automate development environment

It’ll be pretty hard to automate your setup if you don’t ever have to start fresh. In fact, if you never have to start fresh, you probably don’t need to do this. One day you’ll get a new machine, or your old machine will need to be reformatted. When this happens, get ready. We’re about to prevent the sadness of a clean start from happening ever again.

Script EVERYTHING

When you’re setting up your new machine, don’t run commands willy nilly in the terminal, write them in a script file. If you adjust a settings file, like a .bashrc or some other dot file, script that change. If you don’t want to script file concatenations, I recommend storing a current version of the dot file in a folder that is under version control. This way you can use git clone in your setup scripts and then symbolic link your dot files to the files you cloned from git.

Test your scripts

Your scripts should be safely repeatable. Run them and make sure all your programs are installed and working correctly. Make sure you keep an eye out for terminal errors while they are running. If you scripted some symbolic links, or if you clone projects from version control, make sure your script can handle if the folders already exist.

Stay organized

Try to keep your scripts organized and easy to maintain. I like to break my setup scripts into separate script files.

I have scripts for :

  • Installing programs
  • Setting up environment variables
  • Setting up color schemes and fonts
  • Setting up vim and all my vim plugins
  • Running all the other scripts

Challenges

This is a tough thing to do. You probably won’t get it 100% perfect, but try and get as close as you can without wasting too much time. The goal is to have a collection of scripts that can get you up and rolling on a new machine within 2 to 3 hours. Once you get these scripts setup, you can commit them to version control, and run them on all your machines when your config changes.

Example config

If you’d like to see my simple setup click here

 

3 Basic Programming Concepts You Need to Know

Let’s start with the basics

Basic Programming Concepts

There are many concepts in programming and computer science which are very important and extremely useful. I encourage you to supplement my post with research, but hopefully you find the 3 basic programming concepts in this post are very clearly important to learning programming. Before we dive into the basics, first you need to make sure you know what programming is.

What is programming

Warning! Over simplifications ahead! 🙂 Programming is how humans talk to computers. Computers are machines that can only do exactly what we tell them to do. When we program, we are giving the computer instructions.

What does the computer do with the instructions?

The computer uses electricity to perform our instructions. All of our instructions end up telling the computer how it should handle the flow of electricity. Humans use these instructions to get the computer to manipulate information. Computers can only use the instructions they are built with. To learn more, research Machine Code.

How DO I TALK TO COMPUTERS??

People have built tools to help them talk to computers. Just like we have translators for speaking to people who don’t speak our language, we have translators for computers. When you program, you will be writing instructions that these translators understand. The translators will the convert your code into instructions the hardware can execute. We call these translators interpreters and compilers.  Make sure you lookup the differences. We call the languages these translators understand programming languages

Basic Programming Concepts

Now that you know you’re talking to the computer, you should be wondering what you’re talking to it about. Generally when we program we are describing information: how to store it, how to manipulate it,  how it’s structured, how to present it, etc.

Information is all around us! Information could be the names of all your friends. It could also be all of the dishes a local restaurant serves. Programming gives you the power to handle vast amounts of available information and do whatever you can imagine with it.

Mystery #1 – What concept is this?

Here’s a concept, written in the Javascript programming language.

var name = 'Micah';
var age = 2;

How about the same example in the Python programming language?

name = "Micah"
age = 2
What is all this nonsense?

 

You might be wondering, why var, why ‘Micah’, why ; WHAT IS HAPPENING!?! Don’t freak out. This is called “syntax”.

Programming languages have rules, the same way we have rules for how to write English sentences. The semi-colon indicates the end of a line. Some languages, like python, don’t need it. Just like English, programming languages change over time, gaining new ways of writing the same concepts.

BASIC PROGRAMMING CONCEPTs #1 – Storing Information

You may have deduced from the examples, that I was storing the word “Micah” and the number “2”. If not, no worries. This stuff is weird. Go look at it again… This concept of associating a value with a name is called assigning a variable.

We are assigning “Micah” to the variable name. As we should, because my name is Micah. Remember clear variable names make your code easy to read and reason about.

We are also assigning the value 2 to the variable called age. Unfortunately this is not my actual age.  Let’s fix that.

Mystery #2 – What concept is this?

Here’s a new concept written in a language you’ve seen before.

var name = 'Micah';
var age = 2;
age = age + 21;

How about the same example in the Python programming language?

name = "Micah"
age = 2
age = age + 21
Okay, I’ve seen addition before…

Fantastic! Addition is a great thing to know! The concept is that we’re manipulating some information that we’ve previously stored. Age is changing from it’s previous value to it’s previous value increased by 21.

BASIC PROGRAMMING CONCEPTs #2 – Manipulating INFORMATION

From the examples you probably saw that I was changing age from 2 to 23. After we store information into variables we often perform operations on them, like addition in the case of numbers. The symbol that indicates an operation is often called an operator. Different types of information handle these operations differently. Programmers can define their own operators, as well as their own types just like they can define variables.

When programmers define their own operations, they tend to be grouped into something called functions. A function is a reusable mapping of some input to some output. For instance, say you have a function called addTwice. It takes in two numbers and outputs the numbers added to each other twice.

function addTwice(firstNum, secondNum) {
 return firstNum + secondNum + firstNum + secondNum;
}
addTwice(5,2);

If this looks crazy to you

  • the word function is a keyword, which tells a programming language, hey, I’m about to tell you something. Var is also a keyword 😉
  • addTwice is the name of the function
  • (firstNum, secondNum) This is how we define the inputs a function can have.
  • Once an input is defined, you can use it inside of the {} block. This will become more clear
  • return is how you output something from a function.
  • addTwice(5,2); This is how you use the function.

PS – If you’re wondering why age isn’t equal to “age + 21”, the words, then congrats. You just realized why we need to use a signifier like quotes around words that aren’t variables.

When would I need to make a function?

If you have some code that you’re copy and pasting, or if you have something that’s a bunch of steps that can be described in a higher level than the steps, try making a function for it. Imagine you have some code that is transferring money between you and a friend, and you want to let others use this code. You could create a function called transferMoney. It would take in 3 parameters, amount, fromPerson, toPerson. After making this function you can now facilitate payments between any two people, without ever changing your code. Re-usability is very important in programming.

MYSTERY #3 – WHAT CONCEPT IS THIS?

Here’s a new concept written in TypeScript. Javascript with types.

class Person {
 name: string;
 age: number;
}

How about the same example in the Python programming language?

class Person: 
 name = ""
 age = 0
Classes? What I’m trying to learn, now I gotta take a class?

Don’t get caught up on that word. What’s in the class? How would you know that? In Javascript things inside the {} are called blocks. Generally things in blocks are related to the code preceding the block. In python blocks are determined by indention, following a colon. So everything that’s indented after the colon is considered a block. Go research blocks. Hint: They’re used for grouping instructions.

Basic Programming Concepts #3 – Structuring INFORMATION

Imagine you had 100 people, and you wanted to store their names and ages. In our first set of examples, you would have tried to make a variable for each person for age and name.

var name1 = 'Micah';
var age1 = 2;
var name2 = 'Matt';
var age2 = 100;
...
var name99 = 'Fonzy';
var age99 = 800;

Now that you’ve seen the example, you might guess that “classes” allow us to describe information with multiple properties. Instead of a  variable holding one piece of information, ‘Micah’, it can hold a name and an age.

var writer = new Person();
writer.name = 'Micah';
writer.age = 2;

Take a moment to pat yourself on the back. You’ve just consumed quite a large amount of information. If you’ve managed to make it this far, and you feel completely lost, don’t freak out. There’s hope. You aren’t going to learn this stuff in one day. You’ll need to mess around with it. I’ll work on getting some interactive code up for everyone.

tldr;

Just make sure you learn :

  1. In programming we store information
    1. variables store information
  2. In programming we manipulate information
    1. functions are blocks of code that take in input and produce output
  3. In programming we structure information
    1. blocks are used to group instructions
    2. classes are used to create structured data.
  4. Google everything. Research. This should be a good starting point.
  5. Dont give up. It’s okay to be confused. It’s okay if it doesn’t work. Keep trying.
  6. Tweet me if too confused, or if you have questions I’ll try to help you. @micahriggan

Thanks for reading!

Thanks!

Thanks!

Simulated Universe : Societies form

Simulated Universe Progress

It’s been a couple of years since the simulation started. Society has started to take shape on quite a few planets in the simulated universe. Basic economies and social structures have developed. Many of the planets in the simulated universe have advanced faster than we thought possible. Three in particular discovered and popularized electricity before they discovered fossil fuels. They are close to discovering nuclear forces. We’re hoping they develop computers soon.

Other planets have advanced much slower. One in particular is advancing much slower than the others. No science. Very poor communication. Terrible social structures preying on the weak. It’s sad.

Listening In

The researchers have discounted the chances of this planet solving the immortality problem before the others. While the scientific progress of the planet is disappointing, the social interactions are quite interesting. A few of the engineers built in an automated language translation feature, so we could watch them and understand what they’re saying. The first implementation of the translation software actually caused them to speak and understand the same language.

What an interesting accident! All the sudden the organisms could understand each other completely. They actually started to advance much faster. Once we realized what was going on we pushed a fixed version of the translation code and everything went back to normal.  They went nuts for a bit, but eventually behaviors normalized.

Funding and Entertainment

Back in our world, there’s quite a lot of intrigue and anger around this project. Some say it’s not ethical to simulate beings like this. Most are willing to concede when pressed if the gains are worth it. I’m not sure how I feel. Originally I didn’t think much of it, but after watching them interact, I’m not sure. In many ways we are very similar.

Speaking of ethically questionable. The administration has started live-streaming the least developed world. There are channels following kings, queens, tribes, wars, religious figures, poor people, and rich merchants. People are loving it. It’s insane. They’re saying we can use the revenue to beef up the computation power and hire more researchers. I thought everyone would be repulsed. Most are just thrilled to have more funding.

Crowd Interactions

Worse, engineering has been tasked with building a way to communicate with individuals on the planet. They want to make the shows interactive, allow viewers to vote on twitter, and then the characters will do what they say. Mike, from engineering, was telling me that they were going to do very small interactions. Apparently they’re going to try and get the organisms to do what the crowd voted via their own free will. I asked how he planned on doing that and he gave me quite a technical machine learning explanation.

From what I understand the organisms have a state transition function given some input they will perform some action, or state change. They’re going to use this function to reverse engineer an input that will result in the action the crowd chooses. Mike says they’re just going to speak directly into the mind of the organism. It’ll be as if they heard a voice in their head. Many of the societies on the planet are religious, so I have no doubt the inputs will be accepted.

I’m disturbed. I’m just hoping this doesn’t somehow affect any of the other planets, or the success of the project. I need this project to work. My daughter’s life depends on it. All of our lives do.

 

Thanks for reading 🙂 

I’m not really good at this yet, so if you have some feedback let me know

If you missed the first part of the story, check it out here

Want to learn programming? Start here

Programming is fun

Programming is fun

So you want to learn to program?

Write some code? Build an app? Make a website? Awesome! Maybe I can help. I taught myself programming and I think that anyone can learn it. If you invest the time and actually play with it, you will learn. Interested?

Start here!

Programming – High Level Overview

I’m going to do a series of posts with the goal of teaching you to code. I’ll start out super simple, generic, and vague. Then I’ll explain programming concepts rather than any language specific topics. Next I’ll start with a high level view of the concepts, so you know where we’re going. Then I’ll cover the basic concepts, which will be combined to show more complicated concepts. Eventually the picture will be filled in, and you’ll understand the concepts. With mastery of the concepts all languages become trivial to learn.

Puzzle out the examples

After I give the overview of the concepts, I’ll start with examples. I learned to program from reading code and trying to puzzle out what it was doing. Hopefully you get some benefit from this as well. Make sure you mess with the examples. Change them around. This will help more than anything.

Video summary

With each post, I’ll include a video explanation, that way those who learn better from videos than reading can benefit. If you have comments or requests or maybe you’ve got a better way of explaining something, let me know in the comments or on twitter. By no means am I the authority on programming. I am just trying to share my knowledge. Hopefully this helps others to learn and progress.

tldr;

  • I’m doing a blog series where my goal is to help you to learn to program
  • I’m going to start with the basic concepts.
  • I’ll show examples with the concepts
  • I want you to try and figure out what the examples are doing
  • I want you to modify the examples
  • I’ll include a video with each post.
  • Hopefully I can help you.

Lets get to it!

Start here!

 

Learning Resources

 

3 ideas per day

by Micah Riggan 0 Comments

Ideas!

I have ideas all the time. I usually don’t write them down. Usually they’re terrible. Sometimes I tell people. That’s usually when I’m informed of a fatal flaw, or that someone else already did it. I don’t mind. Criticism helps me come up with better ideas. That’s why I want to start doing 3 ideas per day.

Teachme chatbot

  • Uses chatbot ai, web crawlers, semantic alysis, NTLP, and reinforcement learning to build a personal teacher
  • Talks to you about your age, interests, current education, goals etc.
  • Searches online for resources related to your interests and goals
  • interests web crawler
  • google, wikipedia, and interests related sites
  • educational sites
  • Analyzes pages to identify core concepts
  • Builds a learning graph where each concept is preceded by concepts you should understand before.
  • learning graph generation via semantic analysis. Words that are frequently used to explain a word are considered dependencies.
  • Navigates you through the knowledge graph, presenting you with questions after each node.
  • Questions are generated via a question generation network
  • Users provide feedback on questions, helping to train the network
  • Allows users to ask questions about topics and finds others who know the answers to those questions. Answers are used to train the teacher.
  • Connects learners with willing mentors

DJ Bot

  • Uses a thermal camera, crowd movement ai, stylistic transfer neural nets, and a sound system to create an automated DJ experience
  • Crowd movement AI provides feedback to a mixing AI that uses stylistic transfer technique, as well and generative networks to mix and produce music that the crowd enjoys.

Group me chat

  • A chat website where you input multiple phrases that you’re interested in talking about. You are placed into a chat with others who used the same phrase.
  • Spinoffs
    • hide the grouping phrase, so the chatters must figure out which phrase grouped them all together. They wouldn’t be allowed to type out any words from the phrases, otherwise they’d be moved to a different room, unless the phrase they said was correct
    • One of the chatters is a bot. The humans must figure out which one is the bot.

Thanks for reading

3 ideas a day!

3 ideas a day!

I love ideas. I enjoy coming up with them. Hopefully you enjoy them too! Let me know in the comments what you think of these ideas, or perhaps some ideas of your own!

The simulated existence

init 1

We’ve finally reached the apex, the pinnacle of scientific progress. Technology, medicine, psychology, physics, economics, all have come together to give us potentially the most useful innovation. Simulated existence. The ability to simulate reality with a near level of detail as our own. At a much faster speed. Today, we’re turning it on.

Tech-billionaires, fearing death, knowing the possibilities of physics and artificial intelligence, dumped money into developing technology to find a solution to death. After countless conferences and papers a seemingly nonsensical solution started to seem feasible. Simulated reality.

At first people thought that they’d plug themselves into the simulated reality. They played with ideas of how they could slow perception down, and play the simulated reality at a faster speed that normal life. This would theoretically double or even triple the human life. Unfortunately the brain has its limits for how fast existence can be perceived. With no good solution in sight, a new idea emerged.

Faster than life

What if, instead of experiencing the simulated reality at double speed, we created a reality with organisms inside of it. The organisms would live in a universe with the same rules as our own. They would have the same pressures as we do. The same bodies as we do. The quality of the universe they experienced would be stripped down to the bare essentials. The goal? To get them to solve the immortality problem for us.

It took almost 20 years of design and engineering and 70 of the worlds richest people dumping almost their entire fortunes into the effort. Finally a system was built that could simulate a good enough reality at 10,00o times our speed. This meant 1 year in our time was 10,000 years their time. The plan was to run the simulated humans for 15 years.

Observation creates reality

We bootstrapped the simulated existence with as much information from our past as possible. As much as we knew, we tried to put in. Achieving a high simulation speed seemed impossible. We had to optimize. We had to cheat. We had to create a universe as realistic as possible, with minimal computation. The solution ended up being perceptual coalescence of reality. Basically we made it to where nothing was calculated until it was perceived or recorded by the simulated humans. It took a team of quantum physicists and computer programmers working closely together for months to finally get the performance at an acceptable rate.

It’s simple. It’s beautiful. It’s complex. And now. It’s on.

 

After talking with a friend about the potential uses of a simulated reality, I got the urge to write a short story about it. Here’s me giving that a shot.

Make sure you follow me on twitter, or subscribe to this blog for the rest of this story 🙂

simulated existence - big bang

simulated existence – big bang