Skip to content

Instantly share code, notes, and snippets.

🌆
The time is out of joint. O cursèd spite. That ever I was born to set it right!

Muromi Ukari ukari

🌆
The time is out of joint. O cursèd spite. That ever I was born to set it right!
  • Here
View GitHub Profile
@ukari
ukari / gist:ce24c97231454ffb7d1e8727c84e9d1b
Created Apr 3, 2019 — forked from Madsy/gist:6980061
Working multi-threading two-context OpenGL example with GLFW 3.0.3 and GLEW 1.8
View gist:ce24c97231454ffb7d1e8727c84e9d1b
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <vector>
#include <cmath>
#include <cstdio>
#include <limits>
#include <chrono>
#include <thread>
#include <mutex>
View or multi values example.lisp
(defstruct nil-ship)
(defun gen-nil () (values))
(defun gen-no-nil () (values 1 2 3))
(defun test-bug-1 () (values-list (mapcar (lambda (x) (make-nil-ship)) (multiple-value-list (gen-nil)))))
(defun test-bug-2 () (values-list (mapcar (lambda (x) (make-nil-ship)) (multiple-value-list (gen-no-nil)))))
(defun test-wanna-1 () (values-list (or (mapcar (lambda (x) (make-nil-ship)) (multiple-value-list (gen-nil)))
(list (make-nil-ship)))))
(defun test-wanna-2 () (values-list (or (mapcar (lambda (x) (make-nil-ship)) (multiple-value-list (gen-no-nil)))
(list (make-nil-ship)))))
View about.md

run fib(1000)

Fib implementation

i = 0
Fib = n => {console.log(i++);
    if (n == 0) {
        return 0;
    }
    if (n == 1) {
@ukari
ukari / fp_list.js
Created Jul 15, 2017
lexical context instead of this
View fp_list.js
let hyper = {
fuckthis_proxy: target => target instanceof Object ? new Proxy(target, {
get: (object, key) => {
if (object[key] instanceof Function) {
return ((x) => (...args) => x[key](...args))(object);
} else {
return object[key];
}
}
}) : target
@ukari
ukari / doremi.js
Last active Jul 8, 2017
毕达哥拉斯
View doremi.js
// run following script in console from https://alemangui.github.io/pizzicato/#sound-from-waveform
// reference: http://web.math.sinica.edu.tw/math_media/d181/18111.pdf
// reference: https://www.zhihu.com/question/20209456/answer/14341469
go = ((hz, volume) => (sound => {
sound.volume = volume || 1;
sound.play();
setTimeout(() => sound.stop(), 250);
})(
new Pizzicato.Sound({
@ukari
ukari / With.js
Last active Apr 22, 2017
with in javascript like in python
View With.js
With = (...files) => ({
then: (success, error) => {
try {
success(...files);
} catch (e) {
if (!!error) {
error(e);
files.map(file => file.close());
return;
} else {
View todo.md
  • 动态读取client_id, client_serect
  • access_token文件处理
@ukari
ukari / 第二篇博文
Last active Apr 13, 2016
#!unmj 三千院凪 ひんにゅう
View 第二篇博文
依然测试用
@ukari
ukari / hola wundo!
Created Apr 13, 2016
#!unmj 测试用
View hola wundo!
test for UnMJ blog
View currying und parital.lisp
(defun f (x y z)
"test function f"
(+ x (* y z)))
(defun curry (arglist body)
(let* ((arg (car arglist))
(newbody `(lambda (,arg) ,body)))
(cond ((equal arg nil) body)
(t (curry (cdr arglist) newbody)))))
You can’t perform that action at this time.