Skip to content

Instantly share code, notes, and snippets.

@korczis
korczis / make-out.txt
Created July 26, 2013 14:28
libar make output
korczis@kx-mint ~/dev/waldboost/libar $ make
g++ -Wall -msse4 -mfpmath=both -O3 -ffast-math -fomit-frame-pointer -finline-functions -D NDEBUG -D _OPENCV `pkg-config --cflags opencv libxml-2.0` -c src/classifier.cpp -o src/classifier.o
gcc -Wall -std=c99 -msse4 -mfpmath=both -O3 -ffast-math -fomit-frame-pointer -finline-functions -D NDEBUG -D _OPENCV `pkg-config --cflags opencv libxml-2.0` -c src/const.c -o src/const.o
g++ -Wall -msse4 -mfpmath=both -O3 -ffast-math -fomit-frame-pointer -finline-functions -D NDEBUG -D _OPENCV `pkg-config --cflags opencv libxml-2.0` -c src/core.cpp -o src/core.o
g++ -Wall -msse4 -mfpmath=both -O3 -ffast-math -fomit-frame-pointer -finline-functions -D NDEBUG -D _OPENCV `pkg-config --cflags opencv libxml-2.0` -c src/core_simple.cpp -o src/core_simple.o
src/core_simple.cpp: In function ‘int scan_image_simple(PreprocessedImage*, TClassifier*, ScanParams*, Detection*, Detection*, int*, ImType)’:
src/core_simple.cpp:388:75: warning: narrowing conversion of ‘x’ from ‘unsigned int’ to ‘
@korczis
korczis / gist:6089362
Created July 26, 2013 14:39
Structure of waldboost detector project
korczis@kx-mint ~/dev/waldboost/detector $ tree
.
├── bin
│   └── demo.exe
├── data
│   ├── car-rear-lbp.xml
│   ├── car-side-lrp.xml
│   ├── CARS-LRD-sz40-a10-q09-train.xml
│   ├── CARS-LRD-sz48-a10-q09-train.xml
│   ├── CARS-LRD-sz56-a10-q09-train.xml
@korczis
korczis / the-scratch.conf
Created September 7, 2013 13:57
Nginx Node.js Proxy with caching, websockets, gzip
proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=cache:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_the_scratch {
server 127.0.0.1:3000 weight=1 fail_timeout=60s;
}
# the nginx server instance
server {
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
meta : {
// Specify where our test files are. Once we get all the tests switched over we can use 'test/js/**/*.spec.js' to automatically load all tests.
specs : ['test/js/src/**/*.spec.js'],
bin : {
coverage: 'js/bin/coverage'
@korczis
korczis / nginx.conf
Created September 28, 2013 04:46 — forked from plentz/nginx.conf
#don't send the nginx version number in error pages and Server header
server_tokens off;
# config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
# to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
// Select box utilizing Select2 functionality that overrides Ember.Select;
// Define view in the same way that you would an Ember.Select view.
// Additional attributes supported are: width, allowClear, and closeOnSelect;
// Example view:
// {{ view App.Select2
// viewName="fieldValueSelect2"
// prompt="Please select a value list"
// contentBinding="controller.fieldValuesLists"
// optionLabelPath="content.name"
// optionValuePath="content.id"
@korczis
korczis / persistentObject.js
Last active December 26, 2015 12:59
PersistentObject = Ember.Object + HTML5 Local Storage
(function (App) {
"use strict";
App.reopen({
PersistentObject: Ember.Object.extend({
_impl: null,
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage
implementationDummy: {
getItem: function (sKey) {
@korczis
korczis / local-storage.js
Last active December 28, 2015 05:39
Really simple localStorage wrapper - depends on modernizr
var storage = {
_impl: null,
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage
implementationDummy: {
getItem: function(sKey) {
if (!sKey || !this.hasOwnProperty(sKey)) {
return null;
}
return unescape(document.cookie.replace(new RegExp("(?:^|.*;\\s*)" + escape(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*"), "$1"));
var agent = navigator.userAgent.toLowerCase();
var is_mozilla = (agent.indexOf("mozilla") != -1);
// popular websites. Lookup if user has visited any.
var websites = [
"http://ajaxian.com/",
"http://digg.com/",
"http://english.aljazeera.net/HomePage",
"http://ha.ckers.org",
"http://ha.ckers.org/blog/",
@korczis
korczis / nginx.thescratch.io.conf
Created November 22, 2013 07:35
nginx as proxy for nodejs cluster with web sockets configured
proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=cache:8m max_size=3000m inactive=600m;
proxy_temp_path /var/tmp;
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_the_scratch {
server 127.0.0.1:3000 weight=1 fail_timeout=60s;
}
# the nginx server instance
server {