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 some.core) | |
;;editor | |
{:id "data-model" | |
:code "" | |
:format "cljs" | |
:doc "model, what are the parts?" | |
:show-implementation? true | |
:show-code? true | |
:show-narrative? true |
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
(def draft-js js/Draft) | |
;; or any other mode of import | |
(def Editor (.-Editor draft-js)) | |
(def EditorState (.-EditorState draft-js)) | |
(def convertToRaw (.-convertToRaw draft-js)) | |
(def convertFromRaw (.-convertFromRaw draft-js)) | |
(defn raw-json | |
[state] | |
(let [content-state (.getCurrentContent @state) |
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
import App from 'dndWrapper'; | |
const grid = 8; | |
const getListStyle = (boardName,isDraggingOver) => ({ | |
background: isDraggingOver ? 'lightblue' : 'lightgrey', | |
padding: grid, | |
width: 400 | |
}); |
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 datascript-diff | |
(:require [datascript.core :as d] | |
[datascript.btset :as btset])) | |
(defn- keys-eq? [a b] | |
(or (identical? (.-keys a) (.-keys b)) | |
(let [achunk (btset/iter-chunk a) | |
bchunk (btset/iter-chunk b)] | |
(and (== (count achunk) (count bchunk)) |
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
;; implementing a React component in pure cljs, no reagent necessary | |
;; using goog.object.extend to create a ES6 class that inherits from | |
;; React.Component | |
;; credit to @thheller | |
(defn MyReact [props context updater] | |
(this-as this | |
(js/React.Component.call this props context updater))) |
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
import React, {Component} from "react"; | |
import {AgGridReact} from "ag-grid-react"; | |
var totalRow = {name: "Total", price1: 6000, price2: 139000}; | |
function getRowHeight(params){ | |
// assuming 50// 15 characters per line, working how how many lines we need | |
return 18 * (Math.floor(params.data.name.length / 15) + 1); | |
//return 100; | |
} |
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
using UnityEngine; | |
using System.Collections; | |
public class MaterialColorChanger : MonoBehaviour | |
{ | |
void Update() | |
{ | |
if (Input.GetKeyDown(KeyCode.R)) | |
{ | |
GetComponent<Renderer> ().material.color = Color.red; |
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
using UnityEngine; | |
using System.Collections; | |
public class CameraLookAt : MonoBehaviour | |
{ | |
public Transform target; | |
void Update () | |
{ | |
transform.LookAt(target); |
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
using UnityEngine; | |
using System.Collections; | |
public class Rotator : MonoBehaviour { | |
// Before rendering each frame.. | |
void Update () | |
{ | |
// Rotate the game object that this script is attached to by 15 in the X axis, | |
// 30 in the Y axis and 45 in the Z axis, multiplied by deltaTime in order to make it per second |