This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.*; | |
| import java.nio.file.*; | |
| import java.awt.event.*; | |
| import java.util.*; | |
| import java.util.function.*; | |
| public class FsWatcher { | |
| private Thread t; | |
| private File file; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| clear; | |
| clc; | |
| sigmoid = @(x) 1 ./ (1 + exp(-x)); | |
| tset = [ | |
| 0, 0, 0 ; % 0 xor 0 = 0 | |
| 0, 1, 1 ; % 0 xor 1 = 1 | |
| 1, 0, 1 ; % 1 xor 0 = 1 | |
| 1, 1, 0 % 1 xor 1 = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const exec = require('child_process').exec; | |
| const conf = require('./package.json').buildjs || {}; | |
| const C0 = '\033[0m', | |
| C1 = '\033[1;34m', | |
| C2 = '\033[1;32m', | |
| C3 = '\033[1;31m'; | |
| const runCmd = (function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link rel='stylesheet' href='style.css'/> | |
| </head> | |
| <body> | |
| <script type='application/x-shader' id='vertex'> | |
| attribute vec3 Position; | |
| attribute float Size, Life; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| c = document.createElement('canvas'); | |
| c.width=innerWidth;c.height=innerHeight; | |
| document.body.appendChild(c); | |
| d = c.getContext('2d'); | |
| d.font='64px\x20Times\x20New\x20Roman'; | |
| d.shadowColor='white' | |
| d.shadowBlur=8; | |
| p = [] | |
| setInterval(function() { | |
| p.push([ Math.random()*innerWidth, Math.random()*innerHeight, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| precision highp float; | |
| varying vec3 fnormal, flight, fpos; | |
| varying vec2 ftextureCoordinate; | |
| varying vec3 fogv; | |
| uniform sampler2D textureSampler; | |
| void main(void) { | |
| vec3 ldir = normalize(flight); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Procedurally generated Minecraft dirt texture. | |
| */ | |
| (function() { | |
| var ctx, imgd; | |
| ctx = document.getElementById('texture').getContext('2d'); | |
| imgd = ctx.createImageData(64, 64); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono' rel='stylesheet' type='text/css'> | |
| <style> | |
| body { | |
| padding: 9rem; | |
| font-size: 4rem; | |
| font-family: 'Ubuntu Mono', monospace; | |
| line-height: 6rem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import qualified Graphics.UI.GLUT as GLUT | |
| import Data.IORef | |
| type Mat3 = ( | |
| GLf, GLf, GLf, | |
| GLf, GLf, GLf, | |
| GLf, GLf, GLf | |
| ) | |
| type Vec3 = ( GLf, GLf, GLf ) | |
| type GLf = GLUT.GLfloat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import System.Random | |
| getCell :: Int -> Int -> [Int] -> Int | |
| getCell x y vec = head $ drop ((clamp y) * 32 + (clamp x)) vec | |
| where clamp i = min 31 (max 0 i) | |
| generation :: Int -> [Int] -> [Int] | |
| generation 0 vec = vec | |
| generation i vec = map step [0 .. length vec] | |
| where |