home    login

Adnan's adventure (b)log

I'm on twitter, my projects are on github. This (b)log is running on mikro.

December, 2018
November, 2018
October, 2018
September, 2018
August, 2018
July, 2018
June, 2018
May, 2018
April, 2018

MySQL query to CSV

mysql dbname -uuser -ppassword -h "host" -e 'query' | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > file.csv

January, 2018
December, 2017
November, 2017
October, 2017
September, 2017
August, 2017
44. Eric Peters // Coffee Commissary // Los Angeles

Flavor notes
“Syrupy, Jammy, Heavy Body, Espresso-like”

Suggested Coffee
“A natural processed Colombian Coffee”

Recipe
Brew Style: Inverted
Coffee: 22 grams
Grind Size: Setting 2 on Handground
Water: 100 grams at 190F
Water-to-Coffee Ratio: 5:1
Brew Time: 1:30

Method
50g bloom for 50 seconds 
Agitate the grounds using a bar spoon 
10 second pour to 100g 
10 second rest 
20 second plunge

https://handground.com/grind/66-recipes-for-amazing-aeropress-coffee

43. Brandon // Handground

Flavor notes
“Brings out the juiciest flavors in the coffee. Thick, full-bodied, espresso-like”

Suggested Coffee
“Natural processed Colombian coffees”

Recipe
Brew Style: Inverted
Coffee: 30 grams
Grind Size: Setting 5.5 on Handground
Water: 120 grams at 184F
Water-to-Coffee Ratio: 4:1
Brew Time: 1:10

Method
Pour 120g of water, stir for 10 seconds
Immediately put cap on and flip on top of cup
Pull plunger slightly to stop coffee from dripping (creates vacuum) 
Wait 40 seconds, press for 20 seconds. 
July, 2017
June, 2017
May, 2017
April, 2017
March, 2017
February, 2017
January, 2017
December, 2016
#48

Why we need style guides

Let's say you start an e-commerce site.

Your first engineer is Picasso during his blue period. Your codebase quickly becomes filled with Picasso blue period javascript files. He paints you a javascript shopping cart without a problem. He's done it a million times before. But this is his best one. It's his masterpiece. And very blue.

Your second engineer is Salvador Dali. He shows up on his first day with a camera, a single paintbrush, a silly mustache, and starts contributing some crazy surrealist javascript files.

This influences Picasso as they work together and Picasso starts switching things up and begins adding cubism files to the codebase. The codebase is so new that Picasso and Dali can continue adding new files at any time with no harm, because there is no maintenance when it's just two engineers adding new functionality. No one is stepping on each other's toes. There's enough paint for everyone.

Then you hire Monet and he comes in and leaves his impression on everything.

Now you have a blue period shopping cart, impressionist image lazy loading, surrealist photo slide show, and cubism style event tracking in /app/assets/javascripts. The javascripts folder becomes a museum.

Let's jump to the future 4 years later. Lots of major functionality has already been built. Picasso has left the company to pursue a company built on a guernica style. Your business focus has shifted a bit and you need someone to extend Picasso's blue period shopping cart to support collaborative shopping (lots of people sharing the same cart in realtime).

Luckily you just hired a rising star in javascript land that likes to spray paint things on the wall, his name is Banksy. So you tell Banksy, "Hey for your first job we need you to modify our shopping cart so it supports collaboration. Timing is really important for the big relaunch, fortunately this should be really easy because we already have Picasso's shopping cart and it's already a masterpiece. Just reuse that."

So Banksy goes in and spray paints over your Picasso shopping cart and makes it collaborative and you have a big successful relaunch.

A month later a bug report comes in about removing items from the shopping cart. Banksy is busy on another project, so you get Monet to go in and fix it.

Monet doesn't know how to use spray paint cans. So his attempts to fix it are sloppy. He breaks the build. He switches back to the brush and just paints over it, but it took a lot longer than it should have because of the time to understand and adopt an unfamiliar style.

When you have over 80 engineers contributing to one codebase, you quickly learn your usual ways of doing things don't work. So we try to turn everyone into Picasso. No matter where you jump in to the codebase, all the files are familiar and look like they were painted by you.

The most important thing, no matter what your preferred javascript style is, is to be consistent when working with a team or a large codebase that will have to be maintained in the future.

The style that works best for our team is our Picasso style since that's how it all started.

We open sourced our style guide so other teams could fork it and turn it into a Monet style guide or a Banksy style guide. Which is lots of fun to watch.

As an individual painter/engineer working on side projects and exploring all the wonderful things you can do with javascript, please throw conventions away and ignore everything anyone has ever said.

It's the only way the world will enjoy the next Picasso.

~ Harrison Shoff

November, 2016
#40

JS Library Batch #1

  • dat.gui.js - A lightweight graphical user interface for changing variables in JavaScript.
  • is.js - Micro check library.
  • messenger.js - Growl-style alerts and messages for your app.
  • Chosen - Chosen is a library for making long, unwieldy select boxes more friendly.
October, 2016
#39

"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects."

-- Robert Heinlein

September, 2016
August, 2016
#30

Added AI players to my simple multiplayer game, check it out at http://pixelwars.hajdarevic.net

#29

What Golang Is and Is Not

Go is an engineering tool, in a much broader sense. To appreciate it properly I think you have to have spent a decent amount of time responsible for the full lifecycle. If all you ever do is write and commit code then much of Go will be lost on you.

July, 2016
#24

I've built a simple multiplayer game with socket.io, crafty.js & node.js. Check it out

June, 2016
May, 2016
#19

IDE script for JetBrains IDEs that enables you to start multiple configurations in debug mode at once.

Go to Tools->IDE Scripting Console, select Groovy as language of choice and paste the code provided. You have to select all lines and press CTRL+ENTER to run the script.

Some people won't have IDE scripting option visible in the menus so you'll have to create manual keystroke binding to open it. Just make sure that you replace configuration names with your own :-)

multiRun = [
  "IRB console: [local] document_storage_service",
  "IRB console: [local] metadata_service",
  "IRB console: [local] table_storage_service",
];

allSettings = com.intellij.execution.RunManager.getInstance(com.intellij.openapi.project.ProjectManager.getInstance().getOpenProjects()[0]).getAllSettings();
executor = com.intellij.execution.ExecutorRegistry.getInstance().getExecutorById(com.intellij.openapi.wm.ToolWindowId.DEBUG);

toBeRun = allSettings.findAll { setting ->
  multiRun.any { setting.toString() == it }
}.each {
    com.intellij.execution.runners.ExecutionUtil.runConfiguration(it, executor);
}
#17

Great concept! sshd port using TOTP

#16

Phrack is back!

#15

Push button power switch with the ability of microcontroller to turn itself off.

#14

How they do deployment at StackOverflow (2016 edition)

April, 2016
#13

After bricking my Garmin Edge 705, I've decided to build my own GPS cyclocomputer. I've ordered all the parts, we'll see how it goes!

#12

So you want to validate an email field that conforms to the RFC822? Here's a "simple" regex for that ;-)

#11

If your Nokia Lumia 920 suddenly starts opening camera app, and the battery starts to drain real quick (i.e. it can't last for more than four-five hours in idle mode) it's the Side Volume Power Camera Switch Button Flex Cable which has malfunctioned. Try replacing it first before buying a new battery... It could save you ~30$

#10

FlexboxPatterns.com - cool resource for some common web page elements done using flexbox.

#9

Lesson we tend to forget from time to time.

#8

Some tips on working with large CSV files in Ruby.

March, 2016
#7

Color Brewer 2 is a really good resource for selecting map color palettes. Their published paper goes a little bit more in detail on why selecting effective color schemes for thematic maps is surprisingly difficult.

#6

Everybody is writing their own databases nowadays.

#5

I have never seen more poetic and in depth comparison of cheaper items.

#4

Cloud design patterns - Microsoft Developer Network

#3

transfer.sh - easy file sharing from the command line

#2

Good post (or perhaps an essay?) on How to Deploy Software