This file contains 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
(ns vr-cljs.core) | |
(enable-console-print!) | |
(defn get-camera | |
"Creates camera with desired aspect ratio." | |
[] | |
(doto (js/THREE.PerspectiveCamera. 75 (/ (.-innerWidth js/window) | |
(.-innerHeight js/window)) | |
0.1 1000) |
This file contains 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
(ns ^:figwheel-always rerenderer.examples.core | |
(:require-macros [cljs.core.async.macros :refer [go-loop go]]) | |
(:require [cljs.core.async :refer [chan <! timeout]] | |
[rerenderer.examples.bird :as b] | |
[rerenderer.core :as r :include-macros true] | |
[rerenderer.browser :refer [browser]])) | |
(enable-console-print!) | |
(defn rotating-rectangle |
This file contains 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
from .base import BaseConfig | |
class Config(BaseConfig): | |
DEBUG = True | |
ASSETS_DEBUG = True | |
CSRF_ENABLED = False | |
FALLBACK_TO_PRODUCTION_IMAGES = True | |
SERVER_NAME = 'localhost:5000' |
This file contains 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
(ns ^:figwheel-always svg-image-example.core | |
(:require-macros [cljs.core.async.macros :refer [go-loop]]) | |
(:require [cljs.core.async :refer [<! timeout]] | |
[om.core :as om :include-macros true] | |
[om-tools.core :refer-macros [defcomponent]] | |
[om-tools.dom :as dom])) | |
(enable-console-print!) | |
(defcomponent rotated-rect-rect |
This file contains 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
(ns svg-image-example.core | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom])) | |
(defn image | |
[{:keys [href x y width height]} _] | |
(reify | |
om/IRender | |
(render [_] | |
(let [html (str "<image x='" x "' y='" y "'" |
This file contains 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
# python 3: | |
In [1]: a = {'x': 10, 'y': 50} | |
In [2]: b = {'a': 5, 'c': 12} | |
In [3]: a.keys() + b.keys() | |
--------------------------------------------------------------------------- | |
TypeError Traceback (most recent call last) | |
<ipython-input-3-5b3174d08fb5> in <module>() | |
----> 1 a.keys() + b.keys() |
This file contains 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
(ns bf.core) | |
(defmulti run-symbol | |
(fn [symbol _] symbol)) | |
(defmethod run-symbol \+ | |
[_ {:keys [pos] :as state}] | |
(update-in state [:stack pos] inc)) | |
(defmethod run-symbol \- |
This file contains 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
# Originally: https://raw.githubusercontent.com/khenderick/micropython-drivers/master/ssd1306/ssd1306.py | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Kenneth Henderick | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
This file contains 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
(ns bf.core) | |
(defn bf> | |
[[stack current]] | |
(let [new-current (inc current)] | |
[(if (>= new-current (count stack)) | |
(conj stack 0) | |
stack) | |
new-current])) |
This file contains 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
from uasyncio.core import get_event_loop | |
from ssd1306 import get_display | |
from ultrasonic import get_ultrasonic | |
from utils import get_gyro, alts | |
def main(): | |
display = get_display(pinout={'sda': 'Y10', | |
'scl': 'Y9'}, | |
height=64, |