Skip to content

Instantly share code, notes, and snippets.

View Alex1990's full-sized avatar
🐢
Get Things Done!

Alex Chao Alex1990

🐢
Get Things Done!
View GitHub Profile
@Alex1990
Alex1990 / alexa.js
Created May 17, 2019 07:08 — forked from chilts/alexa.js
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip')
.pipe(unzip.Parse())
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
})
;
@Alex1990
Alex1990 / open-source-search-compare.md
Created August 24, 2017 07:43 — forked from jeremyfelt/open-source-search-compare.md
Comparing open source search solutions
@Alex1990
Alex1990 / pagination.md
Created July 13, 2016 16:00 — forked from mislav/pagination.md
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

@Alex1990
Alex1990 / d3-tip-browserify.js
Created July 5, 2016 06:47 — forked from Willmo36/d3-tip-browserify.js
d3-tip with browserify and webpack
let d3 = require("d3");
let d3tip = require("d3-tip");
d3tip(d3);
@Alex1990
Alex1990 / post-merge
Created March 21, 2016 06:52 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@Alex1990
Alex1990 / .jshintrc.js
Last active August 29, 2015 14:08 — forked from haschek/.jshintrc
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true