Skip to content

Instantly share code, notes, and snippets.

@speric
speric / gifts.md
Last active August 29, 2015 14:08
Gift Ideas For Young Engineers
  • Leatherman for young'ins ($54) Comes with the knife blade detached which can be added when 'earned:' http://gearjunkie.com/leatherman-leap-kids-multi-tool
  • Weather Lab ($15) This is more science oriented. Science can be boring at times, but carefully noting numbers and charting phenomenon to find correlation is a concept all should understand. www.smartlabtoys.com/you-track-it-weather-lab.html
  • Robo Link A ($25) Kit that builds five robot variations. It's not an intelligent (interactive) robot. It's mean to learn bout gears (mechanical engineering). www.makershed.com/products/robo-link-a
  • Lego Mindstorms EV3 ($350) shop.lego.com/en-US/LEGO-MINDSTORMS-EV3-31313 Ultimate lego kit, comes with motors, sensors and programmable controller which allows you to write programs and built ultimately anything (robots, machines, etc.). You can use their graphical programming language or venture out into RobotC, which is C-based. Make serious robots without electronics to get in the way.
  • **Flexbot
@speric
speric / keybase.md
Created August 8, 2014 18:09
keybase.md

Keybase proof

I hereby claim:

  • I am speric on github.
  • I am speric (https://keybase.io/speric) on keybase.
  • I have a public key whose fingerprint is 17C2 5F10 32BF FAF5 AF67 880A FFB0 589B 47F6 E4BC

To claim this, I am signing this object:

@speric
speric / shortlog.md
Last active August 29, 2015 14:03
Short Log
# alias clean-branches="git branch --merged master | grep -v \"\* master\" | xargs -n 1 git branch -d"
$ git co master
$ git pull
$ clean-branches
$ git shortlog $VERSION..HEAD
@speric
speric / poodir-notes.md
Last active January 24, 2024 10:31
Notes From "Practical Object-Oriented Design In Ruby" by Sandi Metz

Chapter 1 - Object Oriented Design

The purpose of design is to allow you to do design later, and it's primary goal is to reduce the cost of change.

SOLID Design:

  • Single Responsibility Principle: a class should have only a single responsibility
  • Open-Closed Principle: Software entities should be open for extension, but closed for modification (inherit instead of modifying existing classes).
  • Liskov Substitution: Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
  • Interface Segregation: Many client-specific interfaces are better than one general-purpose interface.
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
require 'sinatra'
require 'openssl'
require 'json'
post '/' do
body = request.body.read
puts "Time : #{Time.now}"
puts "Actual Signature : #{request.env['HTTP_X_CHARGIFY_WEBHOOK_SIGNATURE_HMAC_SHA_256']}"
puts "Computed Signature: #{signature(body)}"
@speric
speric / books.md
Created November 20, 2013 12:59
Books On The Cold War and Espionage

On the KGB, you have the Mitrokhin Archive. Several books got squeezed out of that one, including "KGB: the Untold Story."

There is an official history of MI6 out, but it deals with WWII/early Cold War. It is a multi-volume work in progress.

"Legacy of Ashes" is the CIA book, written by NYT reporter Tim Weiner. While the author tries to be comprehensive, he sticks mostly to CIA failures (because they are public). Successes are too few and/or too secret?

James Bamford's "Body of Secrets" is the better read, focusing on the NSA. Successes and failures get printed.

"Blind Man's Bluff" is a partial history of submarine-based US espionage, notable for its reliance on public documents and interviews with named persons. There are no anonymous sources quoted, ever.

@speric
speric / bialetti-tips.md
Last active December 28, 2015 08:08
Bialetti Moka Express tips

Bialetti Moka Express Tips

  • Put hot water inside the chamber just below the valve. Too much air will have your coffee pop out too fast, the process must be as slow as possible.

  • As soon as coffee starts to spill, turn down the heat to minimum and shut it off when 1/3 or 1/2 of the pot is filled. The rest will flow anyhow and you don't get a "tea-like" coffee.

  • Most important: coffee brewing with Moka or Expresso machines strongly depends on atmospheric pressure. You should grind yourself your beans accordingly to weather: good weather (high pressure) will need a finer ground, bad weather will need a coarser ground.

  • The quality of the final products depends also on the filter holes size.

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@speric
speric / gist:6096965
Created July 28, 2013 01:20
vimtutor Lesson Summaries
Lesson 1 SUMMARY
1. The cursor is moved using either the arrow keys or the hjkl keys.
h (left) j (down) k (up) l (right)
2. To start Vim from the shell prompt type: vim FILENAME <ENTER>
3. To exit Vim type: <ESC> :q! <ENTER> to trash all changes.
OR type: <ESC> :wq <ENTER> to save the changes.