Skip to content

Instantly share code, notes, and snippets.

View fanyer's full-sized avatar

Fy fanyer

  • Somewhere on Earth
View GitHub Profile
@fanyer
fanyer / .block
Created January 19, 2020 03:43 — forked from kerryrodden/.block
Sequences sunburst (d3 v4)
license: apache-2.0
@fanyer
fanyer / .vimrc
Created July 20, 2022 02:07 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@fanyer
fanyer / get-script-promise.js
Created February 2, 2023 02:53 — forked from james2doyle/get-script-promise.js
Async load a script in the page and run it. Uses promises
// this function will work cross-browser for loading scripts asynchronously
function loadScript(src) {
return new Promise(function(resolve, reject) {
const s = document.createElement('script');
let r = false;
s.type = 'text/javascript';
s.src = src;
s.async = true;
s.onerror = function(err) {
reject(err, s);
@fanyer
fanyer / downloadjsonascsv.js
Created February 13, 2023 11:44 — forked from royashbrook/downloadjsonascsv.js
Button Handler to download some JSON as CSV
//bind onclick to downloadcsv.
//o should be the json you want to turn into a table
//h should be a string array for the header row, or this can be null and it will use the keys from the first record
//n is the name of the file, csv will be appended. if omitted it will just be 'data.csv'
export const downloadcsv = (o,h,n = 'data') => {
downloadFile( toCSV(o,h) , n + '.csv', 'text/csv' );
}
const toCSV = (o,h) => {
const a = (v) => `"${v.join(`","`)}"`
let csv = []
@fanyer
fanyer / shell-out.ps1
Created March 3, 2023 08:01 — forked from kreig303/shell-out.ps1
Powershell aliases for git and npm
##
# POWERSHELL SPECIFIC
##
Set-Alias clr clear # slight contraction of clear command
function brc { Start notepad "C:\Users\kzimmerman012\Documents\PowerShell\profile.ps1" } # for editing this file
function Reload-PowerShell { Start-Process pwsh; exit } # reload PowerShell Core
Set-Alias relo Reload-PowerShell
function lw { dir | fw } # wide listing
function up { cd .. } # better back
function rmraf { Remove-Item -Recurse -Force $args[0] }