Skip to content

Instantly share code, notes, and snippets.

View rmacy's full-sized avatar
✌️
Lovin life!

Ryan Macy rmacy

✌️
Lovin life!
View GitHub Profile
@rmacy
rmacy / latency.txt
Created June 6, 2012 01:21 — forked from ehaughee/latency.txt
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
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
@rmacy
rmacy / regexres.md
Created November 15, 2012 19:43 — forked from ehaughee/regexres.md
Regular Expression Resources
critics = {
'Lisa Rose': {
'Lady in the water': 2.5,
'Snakes on a plane': 3.5,
'Just my luck': 3.0,
'Superman returns': 3.5,
'You, Me and Dupree': 2.5,
'The night listener': 3.0,
},
'Gene Seymoud': {

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@rmacy
rmacy / squasher.py
Last active December 20, 2015 06:09
import sys
import os
import glob
def get_contents(file):
with open(file, mode='rU') as f:
for line in f:
yield line
def write_contents(file, iterable):

Reciprocal Needs in the Employment Relation

We can look at two sides of the management coin: What do the individuals get out of it? And what benefit does the whole system derive from it?

I will disregard any benefits that accrue to managers just by holding the position of managing. Those are just circular logic. Circular logic abounds in discussions of management and hierarchy. For example, consider status reports. It will be said that status reports are necessary so managers know what their employees are working on. It’s

Here are some tidbits from my Glass Services teardown (not actually an APK teardown, more like a odex teardown)

In summary: nothing groundbreaking; everything in here is known anyways.

Eye Gestures

In GlassGestureService, the service detecting winks, there's this enum:

STUN implementations

  • stund
  • Content: server daemon and test client for STUN, RFC-3489 only
  • URL does not load, the project seems abandoned
  • The code is also available on SourceForge, last update was on January 2012
  • TCP and TLS modes not supported
  • The server needs two IPs, it’s mandatory and can not be configured
  • C++, no extra libraries required, Windows port available
  • Version = 0.97 (0.96 package available on Debian, 5 years without updates)
@rmacy
rmacy / README.md
Created July 13, 2016 20:00 — forked from joshdover/README.md
Idiomatic React Testing Patterns

Idiomatic React Testing Patterns

Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.

Setup

I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a beforeEach. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern that gives great defaults for each test example but allows every example to override props when needed:

@rmacy
rmacy / animal.js
Last active May 3, 2018 21:30
About function chaining in Javascript
class Animal {
constructor() {
this.pace = null;
}
walk() {
this.pace = "walking";
console.log('our animal is', this.pace);