Skip to content

Instantly share code, notes, and snippets.

@toruta39
toruta39 / .minttyrc
Last active November 28, 2023 12:36
mintty config (msys2)
RowSpacing=2
FontHeight=10
Locale=C
Charset=UTF-8
Transparency=low
Font=JetBrains Mono
BoldAsFont=yes
FontSmoothing=default
ForegroundColour=160,160,160
BackgroundColour=27,29,30
@toruta39
toruta39 / README.md
Last active October 28, 2018 10:45 — forked from johannrichard/homebridge
Systemd Service for homebridge (http://github.com/nfarina/homebridge)

Systemd service for homebridge

Setup

sudo cp homebridge /etc/default
sudo cp homebridge.service /etc/systemd/system

Config

@toruta39
toruta39 / user.js
Created August 10, 2017 08:09
HideMixpanelMenu
// ==UserScript==
// @name HideMixpanelMenu
// @namespace HMPM
// @version 0.1
// @description Hide menu feature in Mixpanel for dashboard displaying
// @author Joshua Zhang
// @include https://mixpanel.com/report/*
// @grant none
// ==/UserScript==
let blacklists = ["*://mail.google.com/*","*://inbox.google.com/*","*://www.figma.com/*","*://configure.ergodox-ez.com/*"]
@toruta39
toruta39 / co-test.js
Created February 23, 2016 01:43
Learning co
var co = require('co');
co(function* () {
var result = 0;
result = yield Promise.resolve(1);
console.log(result); // 1
result = yield Promise.resolve(result + 1);
console.log(result); // 2
return 3;
}).then(function(res) {
@mixin e($element) {
@at-root {
#{&}__#{$element} {
@content;
}
}
}
@mixin m($modifier) {
@at-root {
let rules = [];
function appendRule(path, callback) {
rules.push([path, callback]);
}
function matchPath(path, currentPath) {
let params = {};
// If there's a '/' in the end of path, trim it.
@toruta39
toruta39 / sortPoints.js
Created October 16, 2015 09:51
Solve z-buffer problem of transparent Points by sorting depth of vertices on each draw
// https://github.com/mrdoob/three.js/commit/8406cd7c6ecbdaca8e9d985158e5403492da48b5
import THREE from 'three';
export default function sortPoints(points, camera) {
var vector = new THREE.Vector3();
// Model View Projection matrix
var matrix = new THREE.Matrix4();
matrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
function randomRGB() {
const c = 0xffffff * Math.random();
return [c >> 16, c >> 8 & 255, c & 255];
}
function BrownNoise(audioContext) {
this.node = audioContext.createBufferSource();
var bufferSize = 2 * audioContext.sampleRate,
buffer = audioContext.createBuffer(1, bufferSize, audioContext.sampleRate),
data = buffer.getChannelData(0);
lastOutput = 0;
for (var i = 0, len = data.length; i < len; i++) {
var white = Math.random() * 2 - 1;