Skip to content

Instantly share code, notes, and snippets.

View Nekodigi's full-sized avatar

Nekodigi

View GitHub Profile
@Nekodigi
Nekodigi / comment.js
Created February 25, 2020 11:37
Simple Comment system
function onClickBtn(){
var val = document.querySelector('#msg').value;
var form = new FormData();
form.append('msg', val);
var xhr = new XMLHttpRequest();
xhr.open('POST', '/comment.php', true);
xhr.onload = function(e){
if(this.status == 200){
var result = this.response;
var comments = document.querySelector('#comments');
float toff = 0;
void setup(){
fullScreen();
//size(1000, 500);
strokeWeight(5);
background(255);
}
void draw(){
float c = 100;
int NI = 100, NJ = 100;
PVector[][] poss = new PVector[NI][NJ];
void setup(){
size(700, 700, P3D);
colorMode(HSB, 360, 100, 100);
}
void draw(){
@Nekodigi
Nekodigi / index.html
Created February 27, 2020 12:58
Upload and preview image
<!DOCTYPE html>
<html lang="jp" dir="ltr">
<head>
<meta charset="utf-8">
<title>file upload test</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="up.js"></script>
<script>$(function(){$.get("up.php", {}, function(resp){
show(resp);
});});</script>
import bpy
import numpy as np
resU = 100
resV = 100
n1 = 1.2
n2 = 1.5
r0 = 2
r1 = 1
ArrayList<PVector> ps = new ArrayList<PVector>();
boolean debug = true;
void setup(){
fullScreen();
strokeJoin(ROUND);
}
void draw(){
//based on this site https://github.com/smacke/pressure-softbody
float r = 10;
float grav = 1100;//gravity
float resolution = 30;
float dt = 0.01;
float mouseR = 200;
Softbody softbody;
void setup(){
float g = 9.8;//accelaration of gravity
ArrayList<Pendulum> pendulums = new ArrayList<Pendulum>();
float Tmax = 2000;
float k = 20;
void setup(){
//fullScreen();
size(1000, 1000);
colorMode(HSB, 360, 100, 100);
strokeWeight(1);
Triangle fromT;
Triangle toT;
void setup(){
fullScreen();
strokeWeight(20);
ArrayList<PVector> vertices = polygon(-width/4, 0, 3, 1000);
fromT = new Triangle(vertices.get(0), vertices.get(1), vertices.get(2));
toT = new Triangle(new PVector(width/4, -height/4), new PVector(width/2, height/4), new PVector(width/4, height/4));
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.