Skip to content

Instantly share code, notes, and snippets.

View jacobsologub's full-sized avatar

Jacob Sologub jacobsologub

View GitHub Profile
import { Pattern, Sampler, Sound, SOULPatch, Note, Step } from 'sattern';
const sampler1 = new Sampler ("Sampler 1");
sampler1.sounds = [new Sound ("./bell.aif", { rootKey: 60, lowKey: 0, highKey: 127 })];
graph.add (sampler1);
//
// ViewController.swift
// HYPNOAppSwitf
//
// Created by Jacob Sologub on 11/16/19.
// Copyright © 2019 Hold Still Inc. All rights reserved.
//
import UIKit
@jacobsologub
jacobsologub / hypno_Platform.h
Created November 16, 2019 06:10
libhypno objective-c wrapper(s)
//
// libhypno_Platform.h
// HYPNOApp
//
// Created by Jacob Sologub on 11/15/19.
// Copyright © 2019 Jacob Sologub. All rights reserved.
//
#import <Foundation/Foundation.h>
@jacobsologub
jacobsologub / crossfade-images.js
Last active November 6, 2019 20:39
hypno instant platform code example - Hold Still Inc.
//
// crossfade-images.js
// libhypno
//
// Created by Jacob Sologub on 29 Oct 2019 9:22:41pm
// Copyright © 2019 Jacob Sologub. All rights reserved.
import { Asset, Time, TimeRange, Clip, Vector, coreimage } from 'hypno';
import { Image, Filter } from 'hypno/coreimage';
@jacobsologub
jacobsologub / air-demo.js
Last active November 6, 2019 17:06
hypno instant platform code example - Hold Still Inc.
//
// air-demo.js
// libhypno
//
// Created by Jacob Sologub on 16 Oct 2019 4:20:00pm
// Copyright © 2019 Jacob Sologub. All rights reserved.
import { Asset, Time, TimeRange, Clip, Transform } from 'hypno';
import * as coreimage from 'hypno/coreimage';
import { Image, Filter, Kernel } from 'hypno/coreimage';
struct objc_ptr {
~objc_ptr() {};
static std::shared_ptr<objc_ptr> create (Type* object) {
return std::shared_ptr<objc_ptr> (new objc_ptr (object));
}
Type* get() {
return static_cast<Type*> (objectHolder.nonretainedObjectValue);
};
struct objc_ptr {
~objc_ptr() {};
static std::shared_ptr<objc_ptr> create (Type* object) {
return std::shared_ptr<objc_ptr> (new objc_ptr (object));
}
Type* get() {
return static_cast<Type*> (objectHolder.nonretainedObjectValue);
};
@jacobsologub
jacobsologub / human-numbers.cpp
Created January 30, 2018 01:45 — forked from cslarsen/human-numbers.cpp
Convert big number to human readable format
/*
* A simple way to format numbers as human readable strings.
* E.g., 123456789 ==> 123 million
*
* Written by Christian Stigen Larsen
* http://csl.sublevel3.org
*
* Placed in the public domain by the author, 2012
*/
if (![self.navigationController.viewControllers containsObject: self]) {
UIGestureRecognizerState panGestureRecognizerState = UIGestureRecognizerStateBegan;
UIPanGestureRecognizer* panGestureRecognizer = (UIPanGestureRecognizer*) self.navigationController.interactivePopGestureRecognizer;
if ([panGestureRecognizer isKindOfClass: [UIPanGestureRecognizer class]]) {
panGestureRecognizerState = panGestureRecognizer.state;
}
if (panGestureRecognizerState != UIGestureRecognizerStateBegan) {
// Back button was tapped..
}