Skip to content

Instantly share code, notes, and snippets.

View tsaiDavid's full-sized avatar
⌨️
:imap kj <Esc>

David Tsai tsaiDavid

⌨️
:imap kj <Esc>
View GitHub Profile
@tsaiDavid
tsaiDavid / 101315-nQueens-bitwise.js
Created October 13, 2015 20:03
nQueens Solution written with bitwise operators
function N(n) {
function Hack(R, e, a, c, t, o, r) {
for (t = ~ (R | e | a) & c; t > 0;)
t ^= o = t & -t, r += Hack(R | o, (e | o) >> 1, (a | o) << 1, c, 0, 0, 0);
return R == c && r++, r
}
return Hack(0, 0, 0, (1 << n) - 1, 0, 0, 0)
};
Verifying my Blockstack ID is secured with the address 1MXeEmZ9oV6aPG9bkoumg9XthxJRxhgfC9 https://explorer.blockstack.org/address/1MXeEmZ9oV6aPG9bkoumg9XthxJRxhgfC9
@tsaiDavid
tsaiDavid / custom.css
Created March 16, 2018 17:03
Slack Custom CSS
/*
Copyright 2017 Bryan Keller (https://github.com/widget-)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@tsaiDavid
tsaiDavid / init.vim
Created March 29, 2018 23:42
.config/nvim/init.vim for paul
" Script to automatically load for NeoVim using `vim-plug`
" https://github.com/junegunn/vim-plug [ Paul, this is as simple vim plugin manager ]
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" Specify a directory for plugins
@tsaiDavid
tsaiDavid / index.html
Last active July 7, 2018 05:52
HFP - #010 Slides
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="https://frontendmasters.com/assets/resources/functionaljs/v2/pointfree.browser.js"></script>
<script src="https://frontendmasters.com/assets/resources/functionaljs/v2/data.maybe.umd.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.8.0/ramda.min.js"></script>
</head>
// Curry Function as shown in "Hardcore Functional Programming in JS"
function curry(fn) {
return function () {
// if there are fewer provided args than originally intended
if (fn.length > arguments.length) {
var slice = Array.prototype.slice
var args = slice.apply(arguments)
// return another fn that can 'delay' application of other args
return function () {