Skip to content

Instantly share code, notes, and snippets.

@jordpo
jordpo / route-action.js
Last active February 1, 2019 05:42
A route-action helper to expose current route handling
import Helper from '@ember/component/helper';
import { inject as service } from '@ember-decorators/service';
import { bind } from '@ember/runloop';
import { getOwner } from '@ember/application';
function findHandler(owner, currentRouteInfo, action) {
const route = owner.lookup(`route:${currentRouteInfo.name}`);
const handler = route.actions ? route.actions[action] : route[action];
if (!handler && currentRouteInfo.parent) {
return findHandler(owner, currentRouteInfo.parent, action);
@sukima
sukima / Makefile
Last active December 14, 2018 17:45
Makefile for compiling PlantUML diagrams
# Makefile for PlantUML
# Author: Devin Weaver (@sukima) <suki@tritarget.org>
# GistID: 52eacde54bf7861b19ee66a07b864583
#
# This handles SVGs PNGs and ASCII outputs.
# It handles included files with the .iuml extension: !include foo.iuml
# All diagrams have the .uml extension and reside in the diagrams directory
# All output is saved to the output directory
#
# make svg - (default) build all diagrams as SVGs
@krsna1729
krsna1729 / cmake-dpdk-app.md
Last active January 31, 2024 21:07
compiling dpdk apps using cmake

Compiling DPDK and set environment var

cd dpdk
make config T=x86_64-native-linuxapp-gcc
make -j
export RTE_SDK=$(pwd)

Create CMakeLists.txt file for linking sample app with DPDK

@weedgrease
weedgrease / .travis.yml
Last active June 28, 2017 19:30
Ember Electron Configs
sudo: required
dist: trusty
language: node_js
osx_image: xcode8.3
group: deprecated-2017Q2
matrix:
include:
- os: linux
node_js: 6
addons:
@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@willurd
willurd / web-servers.md
Last active May 4, 2024 07:22
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

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