Skip to content

Instantly share code, notes, and snippets.

View dragosbulugean's full-sized avatar
🎯
Focusing

Dragos Bulugean dragosbulugean

🎯
Focusing
View GitHub Profile
// import "spectre.css/docs/dist/spectre.min.css"
import "./app.scss"
import * as React from "[email protected]"
import * as ReactDOM from "react-dom"
import { Router, Route, IndexRoute, hashHistory } from "react-router"
import { state } from "./accounts/state"
import { Login, Signup, CodeVerification, routes as accountRoutes } from "./accounts"
import { Board } from "./board/board"
import { TechSelector } from "./board/techselector"
// import * as Favicon from "react-favicon"
const {
FuseBox, SassPlugin,
CSSPlugin, TypeScriptHelpers,
JSONPlugin, HTMLPlugin, SVGPlugin,
CSSResourcePlugin, Sparky,
} = require("fuse-box")
const homeDir = "./"
Sparky.task("clean", () => {
{
"name": "xxx",
"version": "1.0.0",
"description": "xxx",
"repository": "none",
"main": "index.js",
"scripts": {
"prestart": "rimraf dist && cpx ./web/static/* dist/app",
"startold": "cross-env NODE_ENV=dev ts-node api/api.ts",
"start": "cross-env NODE_ENV=dev node fuse.js"
export abstract class Wrapper<T> {
constructor() {
console.log("type:", Reflect.getMetadata('design:type', this))
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>d3.js selection frame example</title>
<link rel="stylesheet" href="app.css">
</head>
<body>
</body>
@dragosbulugean
dragosbulugean / README.md
Created May 7, 2017 09:49 — forked from lgersman/README.md
d3.js selection frame example.
  • Click into the drawing area to start the selection frame
  • move the mouse to resize the selection frame
  • Release the mouse button to resize the selection frame

(The circles are just for illustrating purposes)

See it live : http://bl.ocks.org/lgersman/5310854

const { focusBlock } = editor.value
if (
focusBlock.type === BlockTypes.h1 ||
focusBlock.type === BlockTypes.h2
) {
const selection = editor.value.selection
if (
selection.isCollapsed &&
selection.focus.offset === focusBlock.text.length
) {
import * as React from 'react'
import { UserResponse } from '../shared/UserAPI'
import { getWindowVar } from './util'
export class CrispChat extends React.Component<{ user?: UserResponse }> {
async componentDidMount() {
// @ts-ignore
if (typeof window !== 'undefined' && !window['$crisp']) {
this.addMainScript()
}