Skip to content

Instantly share code, notes, and snippets.

View alumican's full-sized avatar

Yukiya Okuda alumican

View GitHub Profile
@banksean
banksean / perlin-noise-classical.js
Created February 15, 2010 10:00
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/
@simoncoulton
simoncoulton / nginx-uwsgi-python3
Created May 7, 2012 04:39
Setting up Nginx, uWSGI & Python3
======================================
Setting up Nginx, uWSGI and Python3
======================================
First off, I'm traditionally a PHP developer, but am looking at moving across to Python. I really struggled to find decent documentation on how to get a server up and running for deploying Python web applications from the point of view of someone coming from PHP. The main problems I came across with documentation were:
1) Only showed you how to run the server for a single web application.
2) Only showed you how to configure the app, not the server it was running on.
My preferred workflow for development is by setting up a new VM in VMware Fusion and then forwarding through all requests to that VM via /etc/hosts. This might not be the optimal way to get things up and running, but it works for me.

esprima系統のtoolはどれも自分の仕事領域を綺麗に分割していて,

  • esprima
    • codeを受け取って, Parser API ASTを返す(tree)
  • escodegen
    • ASTを受け取って, 適切なcodeに変換する
    • この時, codegenの職務の一つとして, codeの意味を変えない形での圧縮も可能 (spaceやindentの削除など)
  • esmangle
    • ASTを受け取って, 変数名の短縮, true / falseなどを!0 / !1に変換したりなどして圧縮したASTを返す
@AtsushiSuzuki
AtsushiSuzuki / MovingAverageFilter.ts
Created January 18, 2016 16:38
pixi.js用移動平均フィルタ
class MovingAverageFilter extends PIXI.AbstractFilter {
static fragmentSrc(size: number, width: number, height: number, direction: string) {
return `
precision lowp float;
varying vec2 vTextureCoord;
varying vec4 vColor;
uniform sampler2D uSampler;
void main(void)
{
gl_FragColor = vec4(0.0);
@KzoNag
KzoNag / TextTranslator.cs
Created September 28, 2016 10:40
UnityからMicrosoft Translator Text APIを利用するコンポーネント
/*
Copyright (c) 2016 Keizo Nagamine
Released under the MIT license
http://opensource.org/licenses/mit-license.php
*/
using UnityEngine;
using UnityEngine.Networking;
using System.Collections;
using System.Xml.Serialization;
@tai-fukaya
tai-fukaya / shader.frag
Created February 28, 2017 06:27
2枚の画像を合成するシェーダー(上の画像に依存)
#version 120
uniform sampler2DRect tex0;
uniform sampler2DRect foreground;
varying vec2 texCoordVarying;
void main()
{
vec4 bgtex = texture2DRect(tex0, texCoordVarying);
@danielbierwirth
danielbierwirth / TCPTestClient.cs
Last active April 27, 2024 20:24
TCP Client-Server Connection Example | Unity | C# | Bidirectional communication sample: Client can connect to server; Client can send and receive messages: Server accepts clients; Server reads client messages; Server sends messages to client
// This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
// To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/
// or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using UnityEngine;
@shunirr
shunirr / criminal_jc.md
Last active February 26, 2024 05:51
女子中学生チケット詐欺事件

criminal_jc

@logue
logue / server.js
Created August 17, 2018 00:00
node.jsによる簡易サーバー。node server.jsとタイプすると、distディレクトリをドキュメントルートとしてWebサーバーが起動する。
/*!
* @file server.js
* @copyright © 2018 By Logue <http://logue.be/>.
* @license MIT
*/
const http = require("http");
const fs = require('fs');
function getType(_url) {
const types = {
@TakanoTaiga
TakanoTaiga / i2t.py
Last active June 21, 2024 08:25
i2t ros2
# Copyright 2023 Taiga Takano
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,