Skip to content

Instantly share code, notes, and snippets.

View Miliox's full-sized avatar

Emiliano Firmino Miliox

View GitHub Profile
@Miliox
Miliox / genaac.sh
Created April 8, 2015 01:31
Generate Audio AAC For Profiles
#! /bin/bash
#
# genaac.sh
# Copyright (C) 2015 Emiliano Firmino <emiliano.firmino@gmail.com>
#
# Distributed under terms of the MIT license.
#
aac_enc() {
# $1 - audio input
@Miliox
Miliox / disable_tracing.sh
Created April 7, 2015 23:39
Enable Script Tracing to Debug Shell Scripts
#!/bin/bash
set +x
set +o functrace
@Miliox
Miliox / NewClasses
Last active August 29, 2015 14:18 — forked from dotMorten/NewClasses
Windows.ApplicationModel.Activation.FileOpenPickerContinuationEventArgs
Windows.ApplicationModel.Activation.FileSavePickerContinuationEventArgs
Windows.ApplicationModel.Activation.FolderPickerContinuationEventArgs
Windows.ApplicationModel.Activation.IContinuationActivatedEventArgs
Windows.ApplicationModel.Activation.IFileOpenPickerContinuationEventArgs
Windows.ApplicationModel.Activation.IFileSavePickerContinuationEventArgs
Windows.ApplicationModel.Activation.IFolderPickerContinuationEventArgs
Windows.ApplicationModel.Activation.IWebAccountProviderActivatedEventArgs
Windows.ApplicationModel.Activation.IWebAccountProviderContinuationEventArgs
Windows.ApplicationModel.Activation.WebAccountProviderActivatedEventArgs
@Miliox
Miliox / ms.sh
Last active August 29, 2015 14:18
Better msbuild command line interface
#!/bin/bash
# title : ms.sh
# descriptipion : better MSBuild for command line
# author : Emiliano Firmino
# date : 2015-04-07
# version : 0.2
# usage : source ms.sh
# notes : change $PATH_TO_MSBUILD to correct path to your msbuild installation
alias msbuild=$PATH_TO_MSBUILD # change here!

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

oclint 0.9 / [stackoverflow]

mkdir build; cd build
scan-build cmake ..

....

oclint-json-compilation-database -v oclint_args \
  "-allow-duplicated-violations -enable-clang-static-analyzer \
  -enable-global-analysis -list-enabled-rules \
@Miliox
Miliox / latency.txt
Last active August 29, 2015 14:12 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@Miliox
Miliox / xenv_thread.h
Last active August 29, 2015 14:12
Portable Linux/Win32 Thread Macro
/*
* xenv_thread.h
* Copyright (C) 2014 Emiliano Firmino <emiliano.firmino@gmail.com>
*
* Distributed under terms of the MIT license.
*/
#ifndef __XENV_THREAD_H__
#define __XENV_THREAD_H__
#ifdef __unix__
#include "DummyDriver.h"
IMPLEMENT_EXTENSION(DUMMY_DEVICE_EXTENSION,
{
//TODO: Define Device Extension
});
extern "C"
NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
{
@Miliox
Miliox / gtest-msvc11.patch
Last active December 20, 2015 01:09
Patch for Google Test to add Visual Studio 2012 Support; Download: http://www.4shared.com/zip/OHGUFeaq/gtest-msvc11.html
From bc6377f6792a60fbc0f28f0f194879e094b92a66 Mon Sep 17 00:00:00 2001
From: Emiliano Firmino <ext-emiliano.firmino@nokia.com>
Date: Sat, 20 Jul 2013 22:43:41 -0400
Subject: [PATCH] add msvc11 solution
---
msvc11/gtest-md.sln | 55 +++++++++
msvc11/gtest-md.vcxproj | 151 +++++++++++++++++++++++
msvc11/gtest-md.vcxproj.filters | 18 +++
msvc11/gtest.sln | 55 +++++++++