Skip to content

Instantly share code, notes, and snippets.

View neekey's full-sized avatar
🎯
Focusing

Neekey neekey

🎯
Focusing
View GitHub Profile
@neekey
neekey / multiple-line-jsx-with-parentheses.tsx
Created April 30, 2021 14:12
[artile-codegist]Why You Should Wrap Your JSX With Parentheses
const homePageLink = currentPage !== 'home' ? (
<a
className="home-page-link"
target="_blank"
href="#home">
Home
</a>
) : null;
@neekey
neekey / dockerfile
Created May 2, 2018 00:53
create node and npm and puppeteer in Docker
FROM python:3.6
ADD . /app
WORKDIR /app
#
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# install node and npm for query thumbnail process
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
"""Run the unit tests."""
import unittest
import sys
def iterate_test_cases(test_suite_or_case):
"""Iterate through all of the test cases in 'test_suite_or_case'."""
try:
suite = iter(test_suite_or_case)
except TypeError:
@neekey
neekey / multipleCacheMemoize.js
Last active February 14, 2017 11:52
multipleCacheMemoize
/* eslint-disable */
import { createSelectorCreator } from 'reselect';
function execFunc(func, ...args) {
return func(...args);
}
function multipleCacheMemoize(func) {
const argsArray = [];
const resultArray = [];
@neekey
neekey / spotlight.js
Created February 1, 2017 23:36
spotlight
/* eslint-disable */
import EventEmitter from 'wolfy87-eventemitter';
import isFunction from 'lodash/isFunction';
import isNumber from 'lodash/isNumber';
import isString from 'lodash/isString';
import isPlainObject from 'lodash/isPlainObject';
function eventDelegate(dom, eventName, className, handler) {
dom.addEventListener(eventName, function (e) {
const target = e.target;
git ftp catchup -u username -p password --remote-root htdoc/daigou --syncroot build --version --verbose ftp://host.example.com:21
@neekey
neekey / app.js
Created June 26, 2016 04:17
React-router-lazy-load-component
// @link https://github.com/reactjs/react-router/blob/v0.13.3/examples/partial-app-loading/app.js
var React = require('react');
var Router = require('react-router');
var { Route, RouteHandler, Link } = Router;
var AsyncElement = {
loadedComponent: null,
load: function () {
if (this.constructor.loadedComponent)
@neekey
neekey / index.html
Created June 21, 2016 10:38
parse-server-github-oauth
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://www.parsecdn.com/js/parse-latest.js"></script>
<script src="https://adodson.com/hello.js/dist/hello.all.min.js"></script>
</head>
<body>
@neekey
neekey / async-to-q.js
Last active August 29, 2015 14:16 — forked from wavded/async-to-q.js
var fs = require('fs')
var Q = require('q')
var fs_stat = Q.denodeify(fs.stat)
var fs_readdir = Q.denodeify(fs.readdir)
var files = [
'./fixtures/file1',
'./fixtures/file2',
'./fixtures/file3',
'./fixtures/file4'
@neekey
neekey / getGitInfo.js
Created August 27, 2014 02:21
获取当前git仓库信息
function getRepoInfo(){
var gitPath = PATH.resolve( process.cwd(), '.git' );
console.log( gitPath );
if( FS.existsSync( gitPath ) ){
var HEAD = FS.readFileSync( PATH.resolve( gitPath, 'HEAD' )).toString();
var CONFIG = FS.readFileSync( PATH.resolve( gitPath, 'config' )).toString();
var result = {};