Skip to content

Instantly share code, notes, and snippets.

@redconfetti
redconfetti / dosn.md
Last active Sep 25, 2021
Distributed Open Social Network
View dosn.md

I wish a suite of protocols existed for the internet, much like FTP, SSH, and HTTP, to support an open distributed social network.

I'd like to adopt or contribute to such a thing. Here is a list of the requirements that I can think of that I'd set for such a suite.

  • Interoperability - Ability to migrate your data between systems
  • Distributed - Much like a website is an isolated resource, each persons own photos, posts, etc. should be stored on their own node. They can pay a company to host their node as a service for them, or they can run their own software that conforms to the protocols to host their own node.
@redconfetti
redconfetti / asynchronous-http-requests-js.md
Last active Aug 30, 2021
Asynchronous HTTP Requests in JavaScript with Fetch, Async, and Await
View asynchronous-http-requests-js.md

Pure JavaScript

JavaScript makes AJAX requests asynchronously, so you can't expect the code to wait for a return value. You have to use a callback function to process the data when it is returned.

In the past you would use a library to make HTTP requests, like jQuery, the AngularJS $http service, or the Axios library (used in older ReactJS applications).

Now JavaScript supports a new API called Fetch.

These libraries, and Fetch, return an object known as a Promise object. The Promise wraps the actual request function in a handler that enables you configure callback functions that are called upon success or failure of the request.

View togaf.md

TOGAF Notes

Definitions

Architecture Metamodel
Describes the organizationally tailored application of an architecture framework, including a metamodel for architecture content
@redconfetti
redconfetti / test.md
Last active Aug 5, 2021
Markdown Example: HTML + Razor
View test.md

Markdown Example

This is an example of a Markdown document that provides HTML with [Razor syntax] included, used in ASP.NET Core.

Example 1

This uses 'cshtml' as the language label.

View rust-cheatsheet.md
@redconfetti
redconfetti / template.rb
Last active Dec 20, 2020
Rails Application Template
View template.rb
# Use this template by running:
#
# $ rails new my_application --api --webpack=vue -m https://gist.githubusercontent.com/redconfetti/011aac614ebe3bd7d798b431fe789f5a/raw/6b917017d2f0ede9f183107f6c9db8cf821a59b3/template.rb
#
# Configure Rspec
puts "-- Configuring Rspec --"
gem_group :development, :test do
gem "rspec-rails"
end
View keybase.md

Keybase proof

I hereby claim:

  • I am redconfetti on github.
  • I am redconfetti (https://keybase.io/redconfetti) on keybase.
  • I have a public key ASAzmSErVw9jGPNYkpArJ0XNRecBxcnAxmPoQ6V42oM7Ago

To claim this, I am signing this object:

View topsters.json
[
{
"google_experiment_mod3": "367",
"numbered": "true",
"google_experiment_mod": "42",
"size": "42",
"titled": "true",
"background": "#000",
"google_experiment_mod2": "942",
"options": "{\"charts\":{\"cards\":\"Untitled Chart\"},\"chosen\":\"cards\"}",
@redconfetti
redconfetti / main.rb
Created Aug 31, 2018
Enumerable.find - Hash and Key and Value Match
View main.rb
# It does work
my_hash = {a: 1, b: 2, c: 3, d: 4, e: 5}
my_hash.find {|k,v| puts "k:#{k},v:#{v}"; v == 3}
# Output:
# k:a,v:1
# k:b,v:2
# k:c,v:3
# => [:c, 3]
@redconfetti
redconfetti / constants-not-overridden.rb
Last active Mar 18, 2016
Constants in super classes not overridden by child classes
View constants-not-overridden.rb
# It appears that a base class method refers to the constant value in that method
# instead of the constant value declared in child classes.
# You have to use a method to provide the expected behavior.
class BaseClass
COLUMNS = []
def self.shared_processor
child_processor(COLUMNS + ['column1'])
end