Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Neekey neekey

🎯
Focusing
View GitHub Profile
@neekey
neekey / multiple-line-jsx-with-parentheses.tsx
Created Apr 30, 2021
[artile-codegist]Why You Should Wrap Your JSX With Parentheses
View multiple-line-jsx-with-parentheses.tsx
const homePageLink = currentPage !== 'home' ? (
<a
className="home-page-link"
target="_blank"
href="#home">
Home
</a>
) : null;
@neekey
neekey / dockerfile
Created May 2, 2018
create node and npm and puppeteer in Docker
View dockerfile
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
View python_unittest_only_skip_support.py
"""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 Feb 14, 2017
multipleCacheMemoize
View multipleCacheMemoize.js
/* eslint-disable */
import { createSelectorCreator } from 'reselect';
function execFunc(func, ...args) {
return func(...args);
}
function multipleCacheMemoize(func) {
const argsArray = [];
const resultArray = [];
View spotlight.js
/* 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;
View git_ftp.sh
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 Jun 26, 2016
React-router-lazy-load-component
View app.js
// @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 Jun 21, 2016
parse-server-github-oauth
View index.html
<!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>
View 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 Aug 27, 2014
获取当前git仓库信息
View getGitInfo.js
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 = {};