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
::-webkit-scrollbar { | |
width: 12px | |
height: 12px | |
} | |
::-webkit-scrollbar-track { | |
background-color: transparent | |
} | |
::-webkit-scrollbar-thumb { |
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: https://github.com/react-component/util | |
let cached; | |
export default function getScrollBarSize(fresh) { | |
if (fresh || cached === undefined) { | |
const inner = document.createElement('div'); | |
inner.style.width = '100%'; | |
inner.style.height = '200px'; |
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: https://github.com/react-component/util | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { createPortal } from 'react-dom'; | |
export default class Portal extends React.Component { | |
static propTypes = { | |
getContainer: PropTypes.func.isRequired, | |
children: PropTypes.node.isRequired, |
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
/** | |
* shortcut plugin | |
* Created date: 2017.01.16 | |
* TODO (feature): | |
* 1. support different key binding in Windows / Mac | |
*/ | |
const keyPairs = [ | |
[8, 'Backspace'], | |
[9, 'Tab'], |
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
OBJS = MovieList.o Movie.o NameList.o Name.o Iterator.o | |
CC = g++ | |
DEBUG = -g | |
CFLAGS = -Wall -c $(DEBUG) | |
LFLAGS = -Wall $(DEBUG) | |
p1 : $(OBJS) | |
$(CC) $(LFLAGS) $(OBJS) -o p1 | |
MovieList.o : MovieList.h MovieList.cpp Movie.h NameList.h Name.h Iterator.h |
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 gulp = require('gulp'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var babel = require('babelify'); | |
function compile(watch) { | |
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel)); |
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 binarySearch(array, start, end, target) { | |
while (true) { | |
if (start > end) return -1; | |
if (end - start < 2) { | |
if (target === array[end]) return end; | |
else if (target === array[start]) return start; | |
else return -1; | |
} | |
var mid = Math.floor((start + end) / 2); | |
if (target === array[mid]) return mid; |
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
/** | |
* @param {string} s | |
* @return {int} | |
*/ | |
var longestPalindromeLength = function(s) { 'use strict' | |
let n = s.length; | |
if (n <= 1) return n; | |
let L = { | |
arr: [], |
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 x, | |
y, | |
i, | |
j, | |
k, | |
begin, | |
end, | |
len, | |
sum, | |
COUNT = 10; |
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
#!/bin/bash | |
# Functions ============================================== | |
# return 1 if global command line program installed, else 0 | |
# example | |
# echo "node: $(program_is_installed node)" | |
function program_is_installed { | |
# set to 1 initially | |
local return_=1 |
NewerOlder