Skip to content

Instantly share code, notes, and snippets.

View Reflejo's full-sized avatar

Martín Conte Mac Donell Reflejo

View GitHub Profile
import argparse
import fnmatch
import json
import os
import re
import sys
from collections import namedtuple
@Reflejo
Reflejo / si.py
Created September 26, 2016 23:08
import bisect
from operator import itemgetter
units = [
(1e-24, 'y'),
(1e-21, 'z'),
(1e-18, 'a'),
(1e-15, 'f'),
(1e-12, 'p'),
import cv2
import json
import numpy
import re
import sys
from operator import itemgetter, attrgetter
from colormath.color_objects import sRGBColor, LabColor
from colormath.color_conversions import convert_color
from colormath.color_diff import delta_e_cie2000
#include <iostream>
#include <fstream>
#include <string>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/opencv_modules.hpp>
#include <opencv2/stitching.hpp>
#include <opencv2/stitching/detail/warpers.hpp>
using namespace std;
import Foundation
let pixels: [[UInt8]] = [
[
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
@Reflejo
Reflejo / bug.swift
Last active October 11, 2015 01:36
protocol SomeProtocol {
var a: Int { get }
}
struct SomeStruct: SomeProtocol {
var a = 0
}
class SomeClass {
var value: SomeProtocol = SomeStruct() {
func test<T>(#something: T) -> T {
return ("abc" as? T) ?? something
}
let str: String? = "abc"
println(test(something: "") == str) // false
println(test(something: "")) // "abc"
$ xcodebuild -workspace 'Test.xcworkspace' -scheme 'Test' -configuration 'Debug' -sdk iphonesimulator -destination 'name=iPhone 6' build
Build settings from command line:
SDKROOT = iphonesimulator8.3
2015-02-10 09:54:05.827 xcodebuild[42416:3126221] DVTAssertions: Warning in /SourceCache/DVTiOSFrameworks/DVTiOSFrameworks-7514.1/DTDeviceKitBase/DTDKRemoteDeviceDataListener.m:79
Details: Running against an old version of MobileDevice; some interaction with proxied devices may be unavailable.
Object: <DTDKRemoteDeviceDataListener: 0x7fcf5cf10c90>
Method: -listenerThreadImplementation
Thread: <NSThread: 0x7fcf5cf09990>{number = 2, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
@Reflejo
Reflejo / gist:1f3c553363c712a8e480
Created February 9, 2015 03:35
UIImagePickerController view hierarchy
PLCameraView
PLPreviewView
PLCameraFocusView
UIImageView
PLCropOverlay
OverlayView
PLCropOverlayBottomBar
UIImageView
PLCropOverlayBottomBarButton
UIImageView
@Reflejo
Reflejo / gist:63c1c9e7ad4b0916ca7a
Last active August 29, 2015 14:14
NSUserDefaults abstraction
//
// Storage.swift
//
// Created by Martin Conte Mac Donell (Reflejo@gmail.com)
//
import Foundation
/**
This struct is the base for Storage Keys. This way we enforce all keys to be in a container to avoid typos