Skip to content

Instantly share code, notes, and snippets.

View KGZM's full-sized avatar

KGZM

  • We Have The Web LLC
  • Brooklyn
View GitHub Profile
@isti115
isti115 / gamepad-control.py
Created June 19, 2020 20:10
Proof of concept blender addon for controlling the viewport with a gamepad (evdev python module needed, only tested under linux)
bl_info = {
"name" : "Gamepad Control",
"author" : "István Donkó",
"description" : "Control the blender viewport using a gamepad",
"blender" : (2, 80, 1),
# "location" : "View3D",
"category" : "Generic"
}
import bpy
@nberger
nberger / recipes.clj
Created July 8, 2015 03:22
recipes with core.logic
(ns recipes.core
(:refer-clojure :exclude [==])
(:use [clojure.core.logic]
[clojure.core.logic.pldb :as pldb]))
(db-rel in-larder i)
(db-rel recipe r)
(db-rel in-recipe r i)
(db-rel compound-ingredient i is)
@malyn
malyn / vim-fireplace-figwheel.diff
Created February 20, 2015 21:12
vim-fireplace patches/hack for compatibility with Figwheel
diff --git a/plugin/fireplace.vim b/plugin/fireplace.vim
index 6c32caa..a415bf8 100644
--- a/plugin/fireplace.vim
+++ b/plugin/fireplace.vim
@@ -232,7 +232,9 @@ function! s:repl.piggieback(arg, ...) abort
else
let arg = ' :repl-env ' . a:arg
endif
- let response = connection.eval('(cemerick.piggieback/cljs-repl'.arg.')')
+ "let response = connection.eval('(cemerick.piggieback/cljs-repl'.arg.')')
@tel
tel / ParserCombinators.hs
Created November 3, 2014 19:54
Monad transformers and parser combinators
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module ParserCombinators where
{-
We'll build a set of parser combinators from scratch demonstrating how
they arise as a monad transformer stack. Actually, how they arise as a
choice between two different monad transformer stacks!
anonymous
anonymous / untrusted-lvl12-solution.js
Created September 2, 2014 16:40
Solution to level 12 in Untrusted: http://alex.nisnevich.com/untrusted/
/*
* robotNav.js
*
* The green key is located in a slightly more
* complicated room. You'll need to get the robot
* past these obstacles.
*/
function startLevel(map) {
// Hint: you can press R or 5 to "rest" and not move the
@kachayev
kachayev / css-parser.md
Last active November 12, 2022 04:20
Parsing CSS file with monadic parser in Clojure
@lygaret
lygaret / index.js
Last active January 18, 2023 17:26
ES6 Quasi-Literal for JSX
define(function(require) {
var React = require('react');
var paramRegex = /__(\d)+/;
var parser = new DOMParser();
var errorDoc = parser.parseFromString('INVALID', 'text/xml');
var errorNs = errorDoc.getElementsByTagName("parsererror")[0].namespaceURI;
// turns the array of string parts into a DOM
// throws if the result is an invalid XML document.
@cstorey
cstorey / index.html
Created February 24, 2014 22:50
A trivial clojurescript paint program using Reagent and core.async. Greatly inspired by the RxJS paint example.
<html>
<head>
<script src="out/goog/base.js" type="text/javascript"></script>
<script src="hello_world.js" type="text/javascript"></script>
<script type="text/javascript">goog.require("hello_world.core");</script>
</head>
<body>
</body>
<script type="text/javascript">hello_world.core.run()</script>
</html>
@XVilka
XVilka / TrueColour.md
Last active June 10, 2024 17:21
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@x-or
x-or / xorgen2.py
Created July 20, 2013 11:30
Cellular Automata with Modular Arithmetic: Advanced Munching Squares
# Cellular Automata with Modular Arithmetic: Advanced Munching Squares
# Copyright (c) 2013, Sergey Shishmintzev
# License: MPL/GPL
# Interpreter: Python 2.7.3 + numpy 1.6.2 + PIL 1.1.7
#
# P.S. Sorry for my English. It isn't my mother tongue.
#
# Reference:
# [Khan1997] A.R. Khan, et.al., "VLSI architecture of a cellular automata machine", 1997,
# http://dx.doi.org/10.1016/S0898-1221(97)00021-7