Skip to content

Instantly share code, notes, and snippets.

View Akira-Hayasaka's full-sized avatar
🏠
Working from home

Akira Hayasaka Akira-Hayasaka

🏠
Working from home
View GitHub Profile
@Akira-Hayasaka
Akira-Hayasaka / class.js
Created September 24, 2020 05:18
js class and func
class Button {
constructor(value) {
this.value = value;
}
value = "";
owner = "Zed";
click_fn = function () {
console.log("[[[[[ function ]]]]]");
console.log("this:", this);
@Akira-Hayasaka
Akira-Hayasaka / obj.js
Created September 24, 2020 05:17
js object and func
const Button = {
init: function (value) {
this.value = value;
},
value: "",
owner: "Zed",
click_fn: function () {
console.log("[[[[[ function ]]]]]");
console.log("this:", this);
https://linuxhint.com/install_ansible_ubuntu/#:~:text=Installing%20Ansible%3A,official%20package%20repository%20of%20Ubuntu.&text=The%20APT%20package%20repository%20cache%20should%20be%20updated.&text=To%20confirm%20the%20installation%2C%20press,Ansible%20should%20be%20installed.
@Akira-Hayasaka
Akira-Hayasaka / ssl.sh
Created July 21, 2020 01:58
Create a Self-Signed SSL Certificate
openssl genrsa -des3 -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
cp server.key server.key.secure
openssl rsa -in server.key.secure -out server.key
openssl dhparam -out dh512.pem 512
sudo apt-get install libboost-all-dev libboost-dev libboost-tools-dev libssl-dev
wget https://github.com/nghttp2/nghttp2/releases/download/v1.41.0/nghttp2-1.41.0.tar.bz2
tar xf nghttp2-1.41.0.tar.bz2
cd nghttp2-1.41.0
./configure --prefix=/usr/local --enable-asio-lib
make
sudo make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
sudo ldconfig
@Akira-Hayasaka
Akira-Hayasaka / c_cpp_properties.json
Created July 14, 2020 07:12
ubuntu 20.4 oF vscode c_cpp_properties.json
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/",
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1",
"${workspaceRoot}/../../../libs/openFrameworks",
@Akira-Hayasaka
Akira-Hayasaka / Dockerfile
Created July 13, 2020 04:36
oF + ubuntu 20.04 docker x11 forwarding
FROM ubuntu:20.04
ENV OF_VERSION 0.11.0
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y wget apt-utils lsb-release software-properties-common
#RUN wget https://openframeworks.cc/versions/v${OF_VERSION}/of_v${OF_VERSION}_linux64gcc6_release.tar.gz
#RUN tar -xzvf /of_v${OF_VERSION}_linux64gcc6_release.tar.gz
COPY of_v${OF_VERSION}_linux64gcc6_release.tar.gz /
@Akira-Hayasaka
Akira-Hayasaka / test.js
Created May 22, 2020 01:16
JS shallow copy vs deep copy
const user = {
name: "Cory",
address: {
state: "California",
},
};
const userCopyShallow = {...user};
const userCopyDeep = {...user, address: {...user.address}};
console.log(" " + user.address.state);
@Akira-Hayasaka
Akira-Hayasaka / EventDispatcher.cs
Last active February 21, 2020 05:51
unity c# event notification & listening
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class Info
{
public Info(int _a, int _b, int _c, string _str)
{
a = _a; b = _b; c = _c; str = _str;
// .h
ofBufferObject pixelBufferBack, pixelBufferFront;
// on setup
pixelBufferBack.allocate(3840 * 2160 * 4, GL_DYNAMIC_READ);
pixelBufferFront.allocate(3840 * 2160 * 4, GL_DYNAMIC_READ);
// func
void fast_tex_to_px(ofTexture& tex)
{