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 / openssl.md
Last active March 14, 2024 17:31 — forked from zhiguangwang/openssl.md
Common OpenSSL Commands with Keys and Certificates

Common OpenSSL Commands with Keys and Certificates

SSL Info

Generate RSA private key with certificate in a single command

openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar

Generate Certificate Signing Request (CSR) from private key with passphrase

openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar

@NoMan2000
NoMan2000 / coredump-php-fpm7.0.4223
Last active June 16, 2022 20:23
Crashing mysqli in php.
[New LWP 1831]
Core was generated by `php-fpm: pool www '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f71a83f8c22 in ?? ()
@NoMan2000
NoMan2000 / Timeout.js
Created December 18, 2014 21:10
Timeout Object to prevent duplicate setTimeout calls
TimeHolder = {};
TimeHolder.delay = 2000;
TimeHolder.value = null;
TimeHolder.cancel = function cancel() {
clearTimeout(TimeHolder.value);
TimeHolder.value = null;
};
window.TimeHolder = TimeHolder;
if (TimeHolder.value === null) {
// Attempting to set a timeout call so that the class does not immediately trigger again.
@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.