Skip to content

Instantly share code, notes, and snippets.

@guzuomuse
guzuomuse / async.py
Created August 26, 2022 10:08 — forked from phizaz/async.py
Python turn sync functions to async (and async to sync)
import functools
def force_async(fn):
'''
turns a sync function to async function using threads
'''
from concurrent.futures import ThreadPoolExecutor
import asyncio
pool = ThreadPoolExecutor()
@guzuomuse
guzuomuse / async.py
Created August 26, 2022 10:08 — forked from phizaz/async.py
Python turn sync functions to async (and async to sync)
import functools
def force_async(fn):
'''
turns a sync function to async function using threads
'''
from concurrent.futures import ThreadPoolExecutor
import asyncio
pool = ThreadPoolExecutor()
@guzuomuse
guzuomuse / 3dWrapper.js
Created November 8, 2015 09:46 — forked from shogito/3dWrapper.js
JavascriptからCSS3のmatrixをいじる用関数達
// random関数定義
var random = function(_num){
return Math.floor(Math.random() * _num);
}
// range関数定義
var range = function(_start, _end, _step){
if (arguments.length <= 1){
_end = _start || 0;
_start = 0;