Skip to content

Instantly share code, notes, and snippets.

import UIKit
extension UIImage {
// colorize image with given tint color
// this is similar to Photoshop's "Color" layer blend mode
// this is perfect for non-greyscale source images, and images that have both highlights and shadows that should be preserved
// white will stay white and black will stay black as the lightness of the image is preserved
func tint(tintColor: UIColor) -> UIImage {
@OrganicIrradiation
OrganicIrradiation / equirectangularToStereographic.m
Created March 3, 2016 18:42
Equirectangular to Stereographic Projections (Little Planets) in MATLAB
% Based upon code by nicoptere: http://en.nicoptere.net/?p=315
function outImage = equirectangularToStereographic(FILENAME,OUTSIZE,CAMDIST,WORLDROTATION)
if nargin < 2
OUTSIZE = [1080,1920];
end
if nargin < 3
CAMDIST = 8;
end
if nargin < 4
WORLDROTATION = 0;
@thatseeyou
thatseeyou / ViewController.swift
Last active January 14, 2025 05:50
How to capture video frames from the camera as images using AV Foundation on iOS
//
// ViewController.swift
//
// Technical Q&A QA1702
// How to capture video frames from the camera as images using AV Foundation on iOS
//
import UIKit
import AVFoundation
import CoreMedia
@vitormeriat
vitormeriat / mqtt-sample.html
Created May 22, 2017 19:22
Demo MQTT, JS, HTML and HighCharts
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Example of plotting live data with websockets and highcharts</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="mqttws31.js" type="text/javascript"></script>
<script type="text/javascript">
var MQTTbroker = 'test.mosquitto.org';
var MQTTport = 8080;
var MQTTsubTopic = 'meriat/sala1/#'; //works with wildcard # and + topics dynamically now
@pjsier
pjsier / .block
Last active July 11, 2023 18:59
Real-Time Line Chart
license: mit
//
// FilePickerPresentedView.swift
// flysight-grapher
//
// Created by richö butts on 7/8/19.
// Copyright © 2019 richö butts. All rights reserved.
//
import Foundation
import SwiftUI