Skip to content

Instantly share code, notes, and snippets.

@punund
punund / main.js
Created March 28, 2023 19:19
Infection's main
import * as ē from 'three'
import { evolve, multiply, pipe, times } from 'ramda'
// import { OrbitControls } from '../../mod/OrbitControls.js'
import { rnd, RN } from '../../mod/rnd.js'
import { createNoise2D } from 'simplex-noise'
import { mergeCurves, curves } from '../../data/curves.js'
import * as xyz from '../../fun/xyz.js'

Keybase proof

I hereby claim:

  • I am punund on github.
  • I am punund (https://keybase.io/punund) on keybase.
  • I have a public key ASCGPt86DsNnvnpXxUx57AIJzjBJLBBVFSjE8NDX3RHbawo

To claim this, I am signing this object:

@punund
punund / data.json
Last active January 9, 2016 11:19
owidget: предлагаемый формат
{
"count": 10,
"locale": "en_UK",
"product": [
{
"name": "KD55X8509C Smart 3D Ultra HD 4k 55\" LED TV",
"maker": "Sony",
"brand": "Bravia",
"price": {
"amount": 102.95,
@punund
punund / hi.js
Created December 24, 2015 12:30
served by @coffee
(function (){ var slice = [].slice;var hasProp = {}.hasOwnProperty;var bind = function(fn, me){return function(){ return fn.apply(me, arguments); };};var extend = function(child, parent) {for (var key in parent) {if (hasProp.call(parent, key)) child[key] = parent[key];}function ctor() { this.constructor = child; }ctor.prototype = parent.prototype;child.prototype = new ctor();child.__super__ = parent.prototype;return child;};var indexOf = [].indexOf || function(item) {for (var i = 0, l = this.length; i < l; i++) {if (i in this && this[i] === item) return i;} return -1; };var modulo = function(a, b) { return (+a % (b = +b) + b) % b; }; return function () {
return alert('hi');
};})();
@punund
punund / trees.hs
Created November 10, 2015 20:58
Data.Tree
data Tree a = Node a (Forest a)
type Forest a = [Tree a]
@punund
punund / ride.hs
Last active November 3, 2015 00:14
leap ∷ Coor → Int2 → WithProblem Maybe Move
leap src dxy = do
let dst = src ~+ dxy
sqr ← squareAtM dst
kind ← captureM $ colorOnSquare sqr
return $ case kind of
SimpleMove -> [ Relocate src dst ]
CaptureMove -> [ Vacate dst, Relocate src dst ]
-- | linear movement by vector ij :: Int2
@punund
punund / list-monad.hs
Last active October 30, 2015 14:34
List monad in action
{- монада это необязательно последовательное исполнение -}
import Control.Monad
newlist ∷ [(Int, Int)]
newlist =
do x <- [1..3]
y <- [11..12]
guard $ x + y > 13
return (x, y)
FROM ubuntu
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install postfix postfix-pcre -y --force-yes
RUN DEBIAN_FRONTEND=noninteractive apt-get install syslog-ng syslog-ng-core -y --force-yes
ADD etc /etc/
RUN cp /etc/resolv.conf /etc/services /var/spool/postfix/etc/
@punund
punund / mass-rename
Last active August 29, 2015 14:15
переименовать файлы
for i in *; do
((c=0))
for j in $i/*; do
((c++))
mv $j $j-$c
done
done
@punund
punund / dokku.log
Created February 11, 2015 20:33
dokku deploy www
++ id -un
+ [[ root != \d\o\k\k\u ]]
+ [[ deploy != plugins-install* ]]
+ [[ deploy != \p\l\u\g\i\n\s\-\u\p\d\a\t\e ]]
+ sudo -u dokku -E -H /usr/local/bin/dokku deploy www
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ [[ -n '' ]]
+ case "$1" in
+ APP=www