This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ofMain.h" | |
| #include <array> | |
| template <std::size_t size_, typename T> | |
| struct mat { | |
| static constexpr std::size_t size = size_; | |
| std::array<std::array<T, size>, size> body; | |
| std::array<T, size> &operator[](std::size_t index) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "ofMain.h" | |
| #include "ofxOsc.h" | |
| #include "ofxExtendedOscMessage.h" | |
| class ofApp : public ofBaseApp { | |
| ofxOscReceiver receiver; | |
| ofxOscSender sender; | |
| public: | |
| void setup() { | |
| sender.setup("localhost", 9005); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Finder = Application("Finder"); | |
| Finder.activate(); | |
| const window = Finder.finderWindows()[0]; | |
| const path = decodeURI(window.target().url().slice(7)); | |
| const currentApp = Application.currentApplication(); | |
| currentApp.includeStandardAdditions = true; | |
| currentApp.doShellScript("/usr/local/bin/code " + path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ofxListenerUtils.h | |
| // | |
| // Created by ISHII 2bit on 2017/03/04. | |
| // | |
| // | |
| #pragma once | |
| #ifndef ofxListenerUtils_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| g++ -Inode_modules/abletonlink/libs/link/include -Inode_modules/abletonlink/libs/link/modules/asio-standalone/asio/include -std=c++11 -DLINK_PLATFORM_LINUX=1 -pthread link.cpp -o link.o |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iterator> | |
| namespace bbb { | |
| namespace detail { | |
| template <typename _> | |
| std::true_type make_true(_ = std::declval<_>()); | |
| }; | |
| template <typename checkee_type> | |
| struct is_iteratable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const MatF2 = { | |
| from_string: M => M.split('\n').map(l => l.replace(/ /g, '')).filter(l => l != '').map(l => l.split('').map(b => 0 ^ b)), | |
| translate: M => M[0].map(() => (M.map(() => 0))).map((l, i) => l.map((_, j) => M[j][i])), | |
| product: (G, H) => { | |
| const res = []; | |
| for(let i = 0; i < G.length; i++) { | |
| const arr = []; | |
| for(let j = 0; j < H[0].length; j++) { | |
| let tmp = 0; | |
| for(let k = 0; k < H.length; k++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var bbb = {}; | |
| bbb.extend = function(dst, src) { | |
| for(var key in src) if(src.hasOwnProperty(key)) dst[key] = src[key]; | |
| return dst; | |
| }; | |
| bbb.math = {}; | |
| var vec2 = (function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fun(org = function(...args) { throw new Error("overload failed", args.map(a => typeof a)); }, ... others) { | |
| const overload_functions = {}; | |
| if(others.length) { | |
| overload_functions[others.map(a => a.constructor.name)] = org; | |
| org = function(...args) { throw new Error("overload failed", args.map(a => typeof a)); }; | |
| } | |
| const f = function(... args) { | |
| return ((overload_functions[args.map(a => a.constructor.name)] || org).bind(this))(... args); | |
| } | |
| f.overload = function(overloading_function, ...args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <bbb/pipe.hpp> | |
| #include <iostream> | |
| int main(int argc, char *argv[]) { | |
| std::string str = "a/b/cdcd/ezzzf/ghi/azzz/czzzd/ef"; | |
| auto res = str | |
| | bbb::replace("zzz", "Z") // "a/b/cdcd/eZf/ghi/aZ/cZd/ef" | |
| | bbb::split("/") // {"a", "b", "cdcd", "eZf", "ghi", "aZ", "cZd", "ef"} | |
| | bbb::filter([](std::string str) { return str.length() < 3; }) // {"a", "b", "aZ", "ef"} |