Skip to content

Instantly share code, notes, and snippets.

View NoMan2000's full-sized avatar

Michael Ryan Soileau NoMan2000

  • Surge Forward
  • Reno, Nevada
View GitHub Profile
@NoMan2000
NoMan2000 / machine.js
Last active June 10, 2021 20:06
Generated by XState Viz: https://xstate.js.org/viz
var AdCreationPages;
(function (AdCreationPages) {
AdCreationPages["CHOOSE_ORGANIC_OR_PAID"] = "organicOrPaid";
AdCreationPages["AD_CREATION_FORM"] = "adCreationForm";
AdCreationPages["ORGANIC_POSTS"] = "organicPosts";
AdCreationPages["PAID_POSTS"] = "paidPosts";
AdCreationPages["PAID_POSTS_CURATED"] = "paidPostsCuration";
AdCreationPages["PAID_POSTS_BESPOKE"] = "paidPostsBespoke";
AdCreationPages["POSTS_PUBLISHED"] = "postsPublished";
AdCreationPages["SAVE_DRAFT"] = "saveDraft";
var AdCreationPages;
(function (AdCreationPages) {
AdCreationPages["CHOOSE_ORGANIC_OR_PAID"] = "organicOrPaid";
AdCreationPages["AD_CREATION_FORM"] = "adCreationForm";
AdCreationPages["ORGANIC_POSTS"] = "organicPosts";
AdCreationPages["PAID_POSTS"] = "paidPosts";
AdCreationPages["PAID_POSTS_CURATED"] = "paidPostsCuration";
AdCreationPages["PAID_POSTS_BESPOKE"] = "paidPostsBespoke";
AdCreationPages["POSTS_PUBLISHED"] = "postsPublished";
AdCreationPages["SAVE_DRAFT"] = "saveDraft";
@NoMan2000
NoMan2000 / maintenanceLog.flow.jsx
Created March 19, 2020 00:12
Pagination in a Component
// @flow
import * as React from 'react';
import { Spinner } from '@blueprintjs/core';
import { SectionWrapper } from '../../commonElements/commonElements';
import SectionHeader from './SectionHeader';
import SectionBody from './SectionBody';
import SectionFooter from './SectionFooter';
type Props = {
customerData: UpdatedCustomerData,
@NoMan2000
NoMan2000 / program.rb
Created April 15, 2019 00:23
A simple ruby program
p "How many items do you want?"
input = gets.to_i
(1..input).each do |n|
if n % 15 == 0
p "FooBar"
elsif n % 3 == 0
p "Foo"
elsif n % 5 == 0
p "Bar"
@NoMan2000
NoMan2000 / missing_numbers.rb
Created March 10, 2019 22:40
Ruby code for code kata, solving missing numbers
require "test/unit"
NOT_A_NUMBER = 1
ALL_GOOD = 0
def update_previous_value_if_one_ahead(i, prev)
if prev == nil
prev = i.to_i
else
check_value = prev.to_i + 1
@NoMan2000
NoMan2000 / blur.rb
Created February 25, 2019 22:13
Ruby Image Blur exercise
require 'test/unit'
# complete for YouTube video.
class Image
attr_accessor :outer_array, :new_outer_array
def initialize(*arr)
@outer_array = arr
end
@NoMan2000
NoMan2000 / readme.md
Last active January 13, 2019 23:00
Ruby Unique methods

Demo code

This is a quick demo for a student on how to solve a problem in ruby, creating their own built-in version of a ruby method.

@NoMan2000
NoMan2000 / db2.sql
Last active March 27, 2018 20:13
DB2 debugging statements.
select * from SYSIBM.TABLES WHERE TABLE_NAME LIKE '%SWPRCRSELP%';
SELECT * FROM SYSIBM;
select r.routinename as FunctionName, r.text as FunctionBody
from syscat.routines r
where r.routinetype = 'F' -- Function
and r.origin in ('U', 'Q'); -- User-defined sourced or query-based
SELECT * FROM SYSIBM.ROUTINES;
@NoMan2000
NoMan2000 / .extensions
Last active March 13, 2018 03:45
My visual studio settings
abusaidm.html-snippets
benjavr.jshintrc-generator
bitlang.cobol
blanu.vscode-styled-jsx
capaj.vscode-standardjs-snippets
chenxsan.vscode-standardjs
christian-kohler.npm-intellisense
DavidAnson.vscode-markdownlint
dbaeumer.vscode-eslint
EditorConfig.EditorConfig
@NoMan2000
NoMan2000 / observe.js
Created September 9, 2017 18:23
Converting a regular object to an observable
function convert (obj) {
Object.keys(obj).forEach(key => {
let internalValue = obj[key]
Object.defineProperty(obj, key, {
get () {
console.log(`getting key "${key}": ${internalValue}`)
return internalValue
},
set (newValue) {
console.log(`setting key "${key}" to: ${newValue}`)