Skip to content

Instantly share code, notes, and snippets.

🎯
throwin darts

brad oyler bradoyler

🎯
throwin darts
Block or report user

Report or block bradoyler

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
View numberToHsl.js
function numToColor (num, maxHue = 350, minHue = 0) {
const hue = num * (maxHue - minHue) + minHue
return `hsl(${hue}, 70%, 45%)`
}
@bradoyler
bradoyler / extract-folder-git.md
Created Sep 16, 2019
extract repo from git folder
View extract-folder-git.md

git commands

git clone --mirror ssh://git@gituhub.com/user/repo.git filtered-repo
cd filtered-repo
git filter-branch --prune-empty --subdirectory-filter some/folder/path/ master
cd ..
git clone ./filtered-repo new-repo
cd new-repo
git status
@bradoyler
bradoyler / csproj-scanner.js
Last active Jul 30, 2019
scan csproj files for usage of ProjectReference
View csproj-scanner.js
const glob = require('glob')
const fs = require('fs');
const xml2js = require('xml2js');
const path = require('path');
function parseFile (filePath, parser) {
fs.readFile(filePath, (err, data) => {
parser.parseString(data, (err, result) => {
const itemgroups = result.Project.ItemGroup;
if (itemgroups && itemgroups.length) {
@bradoyler
bradoyler / rest-client.js
Last active Jan 7, 2019
Simple Rest API client for node with support for JWT (bearer authentication) - requires Axios
View rest-client.js
const debug = require('debug')('rest-client')
const axios = require('axios')
const https = require('https')
module.exports = ({ baseURL, timeout = 20000 } = {}) => {
if (!baseURL) {
baseURL = 'https://localhost:5001/api'
}
const instance = {}
@bradoyler
bradoyler / .block
Last active Sep 6, 2018
Annotated Venn
View .block
license: mit
View walmartpoints.js
// TODO: convert to geojson
var features = [["5992", [44.6504003, -93.2971104], "m"], ["2925", [38.3090139, -122.2833277], "m"], ["3258", [44.0459028, -123.1693478], "m"], ["3829", [36.3089363, -82.4037918], "m"], ["4108", [36.1961294, -94.1839461], "m"], ["3126", [39.6252614, -104.7940466], "m"], ["2058", [35.8372108, -78.6074304], "m"], ["3758", [47.7915764, -96.6073175], "m"], ["1447", [46.6945384, -92.1069175], "m"], ["296", [35.2178954, -93.1664602], "m"], ["5639", [33.8009759, -117.9423561], "m"], ["3646", [32.9700244, -80.0031996], "m"], ["2548", [37.6589269, -82.2710627], "m"], ["3894", [38.0377086, -84.4220326], "m"], ["6480", [33.3078738, -111.9016392], "m"], ["5300", [27.8472347, -82.354341], "m"], ["913", [43.2915783, -91.7537152], "m"], ["4648", [30.6780894, -88.1948548], "m"], ["829", [35.652383, -105.9998077], "m"], ["3485", [34.8639269, -83.9980185], "m"], ["3415", [28.1472522, -82.7435188], "m"], ["4147", [35.8181516, -78.8449974], "m"], ["3355", [36.1561688, -115.0796748], "m"], ["2876", [35
View points.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View ObjectAssign.Extension.cs
public T ObjectAssign(T source)
{
Type t = this.GetType();
var properties = t.GetProperties().Where(prop => prop.CanRead && prop.CanWrite);
foreach (var prop in properties)
{
var value = prop.GetValue(source, null);
if (value != null)
prop.SetValue(this, value, null);
@bradoyler
bradoyler / zcash.md
Last active May 2, 2018
ZCash (ZEC ) install Ubuntu 16
View zcash.md

Command-line install instructions:

sudo apt-get install apt-transport-https
wget -qO - https://z.cash/gpg-pubkeys/zcash.asc | sudo apt-key add -
sudo echo "deb https://apt.z.cash jessie main" | sudo tee /etc/apt/sources.list.d/zcash.list
sudo apt-get update
sudo apt-get install zcash
zcash-fetch-params
mkdir ~/.zcash
@bradoyler
bradoyler / fipsToAbbrev.json
Last active Apr 1, 2018
hash map for looking up the State code for a FIPS
View fipsToAbbrev.json
{
"01":"AL",
"02":"AK",
"04":"AZ",
"05":"AR",
"06":"CA",
"08":"CO",
"09":"CT",
"10":"DE",
"11":"DC",
You can’t perform that action at this time.