Skip to content

Instantly share code, notes, and snippets.

⚫️
Creating Black holes.

Pankaj Doharey metacritical

⚫️
Creating Black holes.
Block or report user

Report or block metacritical

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@metacritical
metacritical / cprint.clj
Created Aug 4, 2019 — forked from kocubinski/cprint.clj
ClojureCLR println with colors in Windows cmd.exe
View cprint.clj
(assembly-load "ClojureClrEx")
(ns clync.core
(:use [clojure.clr.pinvoke :only [dllimports]]))
(dllimports
"Kernel32.dll"
(GetStdHandle IntPtr [Int32])
(SetConsoleTextAttribute Boolean [IntPtr UInt32]))
@metacritical
metacritical / handle-escape-opentk.clj
Last active Jul 30, 2019
Inherit GameWindow using proxy and Override OnUpdateFrame method.
View handle-escape-opentk.clj
(ns core
(:gen-class))
(assembly-load-from "./extern/OpenTK/lib/net20/OpenTK.dll")
(import [System]
[System.IO]
[System.Console]
[System.Drawing]
[OpenTK]
@metacritical
metacritical / core-import.clj
Last active Jul 29, 2019
Creating The Game window.
View core-import.clj
(ns core
(:gen-class))
(assembly-load-from "./extern/OpenTK/lib/net20/OpenTK.dll")
(defn -main[]
(Console/WriteLine "Starting OpenTK Window."))
@metacritical
metacritical / core.clj
Last active Jul 29, 2019
Clojure-CLR Hi World!
View core.clj
(ns core
(:gen-class))
(import [System])
(defn -main[]
(System.Console/WriteLine "Hi World"))
@metacritical
metacritical / build.sh
Last active Jul 30, 2019
Clojure-CLR build script for hi world.
View build.sh
#!/usr/local/bin/bash
runtime="mono"
cljcomp=$CLOJURE_LOAD_PATH/Clojure.Compile.exe
compile(){
CLOJURE_COMPILE_PATH=build/ $runtime $cljcomp core
}
link_dlls(){
View BoidBehaviour.cs
using UnityEngine;
public class BoidBehaviour : MonoBehaviour
{
void Update()
{
Boids.Core.update(transform);
}
}
@metacritical
metacritical / Errors
Created Jul 24, 2019
Clojure-1.9.0 Binary Errors with Mono on Mac
View Errors
>> mono all/net40/Clojure.Main.exe
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Clojure.CljMain' threw an exception. ---> System.TypeInitializationException: The type initializer for 'clojure.lang.RT' threw an exception. ---> System.IO.FileNotFoundException: Invalid Image
at (wrapper managed-to-native) System.Reflection.Assembly.LoadFrom(string,bool,System.Threading.StackCrawlMark&)
at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00002] in <f7cedb26ce694cd281e4450870c6fe49>:0
at clojure.lang.RT.DoInit () [0x0000a] in <814990e2d98549148927c9ed5c97f15e>:0
at clojure.lang.RT..cctor () [0x01f89] in <814990e2d98549148927c9ed5c97f15e>:0
--- End of inner exception stack trace ---
at Clojure.CljMain..cctor () [0x0000f] in <f5aa122c398747a0aa41452d219b2965>:0
View clojure
#!/usr/bin/env bash
# Version = 1.9.0.397
set -e
function join { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; }
# Extract opts
print_classpath=false
@metacritical
metacritical / README.md
Created Dec 8, 2018 — forked from bhauman/README.md
ClojureScript minimal dev and prod setup.
View README.md

Recent improvements to the ClojureScript compiler have greatly simplified setting up development versus production outputs.

This example uses Figwheel as something that you want to exclude for production, but the pattern is general.

With this simple setup you only need one html file/view and it will work for developement and production.

@metacritical
metacritical / js-in-cljs.md
Created Dec 5, 2018 — forked from jmlsf/js-in-cljs.md
Using JavaScript modules in ClojureScript
View js-in-cljs.md

Using JavaScript Libraries from ClojureScript

Using JavaScript libraries from ClojureScript involves two distinct concerns:

  1. Packaging the code and delivering it to the browser
  2. Making ClojureScript code that accesses JavaScript libraries safe for advanced optimization

Right now, the only single tool that solves these probems reliably, optimally, and with minimal configuration is shadow-cljs, and so that is what I favor. In paricular, shadow-cljs lets you install npm modules using npm or yarn and uses the resulting package.json to bundle external dependencies. Below I describe why, what alternatives there are, and what solutions I disfavor at this time.

Packaging and Delivering Code

You can’t perform that action at this time.