Skip to content

Instantly share code, notes, and snippets.

@rkgarg
rkgarg / measure.rb
Last active August 29, 2015 14:20 — forked from camertron/measure.rb
#!/bin/env ruby
# lazy hack from Robert Klemme
module Memory
# sizes are guessed, I was too lazy to look
# them up and then they are also platform
# dependent
REF_SIZE = 4 # ?
OBJ_OVERHEAD = 4 # ?
#!/usr/bin/env ruby
if ARGV.size != 2
puts "Usage: #{$0} <from_language> <to_language>"
exit -1
end
require 'rubygems'
require 'ya2yaml' # this gem is needed for this to work!
require 'yaml'
@rkgarg
rkgarg / post-repeat-directive.js
Last active June 28, 2017 11:41
Angular ng-repeat Benchmark
// Post repeat directive for logging the rendering time
angular.module('myApp').directive('postRepeatDirective',
['$timeout',
function($timeout) {
return function(scope) {
if (scope.$first)
window.a = new Date(); // window.a can be updated anywhere if to reset counter at some action if ng-repeat is not getting started from $first
if (scope.$last)
$timeout(function(){
console.log("## DOM rendering list took: " + (new Date() - window.a) + " ms");
// TipTip CSS - Version 1.2
@mixin tiptip_grey
background-color: $greylight
color: $white
@mixin tiptip_black
background-color: $black
color: $white