Skip to content

Instantly share code, notes, and snippets.

Brian Boyko brianboyko

Block or report user

Report or block brianboyko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brianboyko
brianboyko / README.md
Last active Aug 21, 2019
Vue Extended Styleguide for Vue-Function-API / Vue 3.0 Proposal
View README.md

Important: This is in the RFC stage. Please comment if you notice typos, code flaws, or even disagree with the conclusions.

I'm still getting used to vue-function-api and haven't had a chance to try it out extensively. In other words, I might be completely wrong on everything. That's okay.

Brian Boyko's Vue.js Style Guide for use with the Vue-Function-API

Guide for developing Vue.js applications for the proposed Vue 3 function API (or the vue-function-api plugin).


@brianboyko
brianboyko / urlUuid.js
Created Mar 8, 2018
Encode and decode UUIDs into URL-safe Base 64
View urlUuid.js
// converts a UUID to a URL-safe version of base 64.
const encode = uuid => {
const stripped = uuid.replace(/-/g, ""); // remove dashes from uuid
const true64 = btoa(
String.fromCharCode.apply(
null,
stripped
.replace(/\r|\n/g, "")
.replace(/([\da-fA-F]{2}) ?/g, "0x$1 ")
.replace(/ +$/, "")
View gist:3b7f517d35610628036367c17336dfe3
import neo4j, { Driver, Session } from "neo4j-driver";
import config from "../config";
const neoDriver: Driver = neo4j.driver(
config.neo.url,
neo4j.auth.basic(config.neo.login, config.neo.password),
{ useNativeNumbers: true }
);
export const neo = (): Session => neoDriver.session();
@brianboyko
brianboyko / looksay.js
Created Jan 24, 2018
Would you like to build a function?
View looksay.js
// Hey Anna, wanna write a function that returns the output for a look and say sequence: https://en.wikipedia.org/wiki/Look-and-say_sequence
function lookAndSaySequence(n) {
// would you like to build a function?
// a function that returns a striiiing.
var lookSay = function(strNum) {
var sayArray = [];
var repeats = 1; // we check to see how many nums
var digit = 0; // and say the num
View normalizedCodes.json
This file has been truncated, but you can view the full file.
{
"10001": {
"zip": "10001",
"city": "New York",
"state": "New York",
"state_abbr": "NY",
"county": "New York",
"lat": 40.7484,
"lng": -73.9967
View zipCodes.csv
We can't make this file beautiful and searchable because it's too large.
zip,city,state,state_abbr,county,lat,lng
00501,Holtsville,New York,NY,Suffolk,40.8154,-73.0451
00544,Holtsville,New York,NY,Suffolk,40.8154,-73.0451
01001,Agawam,Massachusetts,MA,Hampden,42.0702,-72.6227
01002,Amherst,Massachusetts,MA,Hampshire,42.3671,-72.4646
01003,Amherst,Massachusetts,MA,Hampshire,42.3919,-72.5248
01004,Amherst,Massachusetts,MA,Hampshire,42.3845,-72.5132
01005,Barre,Massachusetts,MA,Worcester,42.4097,-72.1084
01007,Belchertown,Massachusetts,MA,Hampshire,42.2751,-72.411
@brianboyko
brianboyko / README.md
Last active Sep 18, 2019
VueJS Best Practices Guide
View README.md

Deverus Vue.js Style Guide

Guide for developing Vue.js applications.

v. 0.0.1

Vue.js is an amazing framework, which can be as powerful as Angular or React, the two big heavy hitters in the world of front-end frameworks.

However, most of Vue's ease-of-use is due to the use of Observables - a pattern that triggers re-renders and other function calls with the reassignment of a variable.

@brianboyko
brianboyko / functional.js
Last active Oct 19, 2017
Functional Tools
View functional.js
// Takes a function and additional arguments to be applied, and returns
// a new function with those provided arguments already partially applied.
export const curry = (f, ...curriedArgs) => (...newArgs) =>
f.apply(null, curriedArgs.concat(newArgs));
// Allows to iterate functions over a variable.
export const Identity = value => ({
value,
map: f => Identity(f(value))
});
View gist:bb192784d6afb6e63d6f4c2c4e2b90f8
-- Read more about this program in the official Elm guide:
-- https://guide.elm-lang.org/architecture/effects/random.html
import Html exposing (..)
import Html.Attributes exposing(src)
import Html.Events exposing (..)
import String exposing (repeat)
import Random
main =
View reduxify.js
// While I started the original Reduxify project on NPM, my repo partner, Johnathan Sun, improved on it.
// However, I still like incorporating my original into my own projects, and so I'm making this Gist for my
// own reference.
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
const pick = (state, list) => list.reduce((pv, cv) => {
pv[curr] = state[curr];
return pv;
You can’t perform that action at this time.