Skip to content

Instantly share code, notes, and snippets.

View billymoon's full-sized avatar

Billy Moon billymoon

View GitHub Profile
@billymoon
billymoon / cell0.js
Last active January 20, 2022 11:48
pseudo-random-data-generator-demo
import faker from "https://cdn.jsdelivr.net/npm/@faker-js/[email protected]/dist/faker.min.js"; ///**import and configure faker**
faker.locales[faker.locale].name.male_prefix = ["Mr.", "Dr."];
faker.locales[faker.locale].name.female_prefix = ["Mrs.", "Miss.", "Dr."];
window.faker = faker;
@billymoon
billymoon / ToggleFormat.py
Last active December 12, 2017 10:09
Hack to have single command to swap semi and standard linting and formatting
import sublime
import sublime_plugin
STANDARD_SETTINGS_FILE = "StandardFormat.sublime-settings"
SEMI_STANDARD_SETTINGS_FILE = "SemiStandardFormat.sublime-settings"
def plugin_loaded():
global standardSettings
global semiStandardSettings
standardSettings = sublime.load_settings(STANDARD_SETTINGS_FILE)
@billymoon
billymoon / cell0.js
Last active October 5, 2017 22:27
untitled
import fiona from 'fiona'
import './lorem'
import './nino'
const seeded = fiona()
seeded.lorem()
seeded.sentence()

react-issuemd-poc

This Gist wa

dcr-generator

undefined

@billymoon
billymoon / functional-pollyfills.carbide.md
Last active October 2, 2016 22:13
functional-pollyfills

functional-pollyfills

@billymoon
billymoon / wordwrap
Created December 30, 2015 19:56
near identical implementation of wordwrap from php.js
// slight discrepency with...
// var str = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestias veritatis, quis sunt cumque quod, dolorum! Itaque, inventore, sed. Nisi natus illum minima architecto, reprehenderit fugiat repellendus doloremque dolore adipisci aspernatur? suscipit, esse delectus tempora dolor aliquam excepturi, tempore non mollitia eum dolorem quidem eius quasi est, explicabo eos doloremque. Impedit! Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illo, dolores, perferendis. At perferendis porro quidem in praesentium quia fuga nihil fugiat ratione. Provident, minima labore blanditiis mollitia sit voluptatibus quod.";
// wordwrap(str, 60, '\n', 2);
// but pretty close to functionally equavalent.
function wordwrap(str, intWidth, strBreak, cut) {
intWidth = typeof intWidth !== 'undefined' ? intWidth : 75;
strBreak = typeof strBreak !== 'undefined' ? strBreak : '\n';
cut = typeof cut !== 'undefined' ? cut : 0;
@billymoon
billymoon / file1.txt
Last active October 31, 2015 14:42
there were 0.17658892646431923 green bottles
there were 0.6299692264292389 green bottles..!