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
function foo(){ | |
document.getElementById("huehue"); | |
} |
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
<!-- | |
SRSHME stands for Simple Realtime Syntax Highlight Markdown Editor | |
which is a showcase of how realtime syntax highlight is possible in Html/Css/JavaScript. | |
Have tested on the latest version of Chrome, Firefox, Opera, Safari and IE 10. | |
Be aware of this code is not optimized. When you typed too many characters, | |
it will become more and more laggy because I choose to do it in a straight way, | |
and since it's just a showcase & tutorial, I will leave it as current state if there is no more critical bugs. | |
--> |
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
var express = require("express"); | |
var path = require("path"); | |
var passport = require("passport"); | |
var localStrategy = require("passport-local"); | |
var bodyParser = require("body-parser"); | |
var cookieParser = require("cookie-parser"); | |
var session = require("express-session"); | |
var bcrypt = require("bcrypt"); | |
var db = require("redis").createClient(process.env.REDIS_URL); |
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 _ from "lodash"; | |
import {fn as isGeneratorFn} from "is-generator"; | |
const generatorMiddleware = store => next => action => { | |
let {dispatch} = store; | |
let generator = findGenerator(action); | |
if(isGeneratorFn(action)){ | |
return runGenerator(dispatch, action, action); | |
} | |
else if(generator){ |
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, { PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { | |
SortableTreeWithoutDndContext as SortableTree, | |
dndWrapExternalSource, | |
insertNode | |
} from 'react-sortable-tree'; | |
import HTML5Backend from 'react-dnd-html5-backend'; | |
import { DropTarget, DragDropContext } from 'react-dnd'; |
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
interface Field { | |
name: string; | |
path?: string; | |
} | |
interface Fields { | |
[name: string]: Section | Field; | |
} | |
interface Section extends Field { |
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-select/dist/react-select.css'; | |
import React from 'react'; | |
import { Field, reduxForm } from 'redux-form'; | |
import Select from 'react-select'; | |
const transValue = (value) => ({ label: value, value }); | |
const Input = ({ input, options = [], showDropdown = false }) => { | |
return <Select.Creatable | |
inputProps={input} |
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 $ from 'jquery'; | |
import _ from 'lodash'; | |
import 'normalize.css'; | |
import "slick-carousel/slick/slick.css"; | |
import "slick-carousel/slick/slick-theme.css"; | |
import './App.css'; | |
const translateArrayIndex = (arr, index) => { | |
const rest = index % arr.length; |
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 from 'react'; | |
import { Field, reduxForm } from 'redux-form'; | |
import AutoSuggest from 'react-autosuggest'; | |
import styles from './styles.css'; | |
const suggestions = [ | |
{ label: 'Apple', value: 1 }, | |
{ label: 'Aqua', value: 2 }, | |
{ label: 'Banana', value: 3 }, | |
{ label: 'Bean', value: 4 }, |
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
// index.js | |
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import Select from "react-select"; | |
import "./styles.css"; | |
const options = [ | |
{ label: "aaa", value: 1 }, | |
{ label: "bbb", value: 2 }, | |
{ label: "ccc", value: 3 } |
OlderNewer