Skip to content

Instantly share code, notes, and snippets.

@dwayne
dwayne / 0-meta.md
Last active August 12, 2021 10:47
Ruby Under a Microscope: Notes (sr bookclub)

Ruby Under a Microscope

Introduction

To understand how Ruby works, read its C source code. After learning each part of Ruby's internal implementation we perform an experiment and use Ruby to test itself.

Most of the book discusses how MRI works.

MRI (Matz's Ruby Interpreter) was invented in 1993 by Yukihiro Matsumoto a.k.a Matz.

@dwayne
dwayne / workflow.md
Last active August 29, 2015 14:17
A workflow for using GitHub project pages to host a static site.

First Time

The gh-pages branch does not exist on the remote.

# Set up the build directory on an orphan branch
$ mkdir build && cd build
$ git init
$ git checkout --orphan gh-pages
@dwayne
dwayne / preface.md
Created January 21, 2015 09:47
Full Stack Web Development with Backbone.js by Patrick Mulder

Preface

The Pipefishbook

Code Examples

To be covered:

  • How to quickly get started with a Backbone.js sandbox
  • How to manage data and state with Backbone.js models
@dwayne
dwayne / https_server.py
Last active May 5, 2020 00:32 — forked from dergachev/simple-https-server.py
Creating a simple HTTPS server in Python.
#!/usr/bin/env python
PORT = 8001
CERTFILE = '/home/dwayne/.ssl/server.pem'
import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('localhost', PORT), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile=CERTFILE, server_side=True)
@dwayne
dwayne / advice.md
Last active August 29, 2015 14:06
Suggestions from Jeff Browning at Pinecone on improving my skills at AngularJS and Rails.

AngularJS

  • Build custom directives. Basic controllers and templates are great, but anything beyond basic interactivity usually requires custom directives. The learning curve for custom directives can be challenging, so just take it one step at a time.
  • Inter-directive communication via controllers.
  • Become very familiar with scope usage, best practices, and pitfalls. Scope inheritance, and encapsulation are some of the areas where Angular can drive you insane, but this knowledge is essential in order to build large-scale, maintainable Angular apps.
  • Explore the differences between Services, Factories, and Providers.
  • Become a testing expert. One thing that I like about the Angular community is that tests are expected and encouraged.

Here are some resources to help:

@dwayne
dwayne / 0-intro.md
Last active February 28, 2023 22:10
My notes from the book "Authority by Nathan Barry".

A Step-By-Step Guide To Self-Publishing

Become an expert, build a following, and gain financial independence.

by Nathan Barry

Table of Contents

@dwayne
dwayne / example.rb
Last active August 29, 2015 14:06
A secure random token generator with tests.
# Generating a unique auth_token for a user
#
# While a user exists with the generated token, generate a new one
Token.generate { |token| User.exists?(auth_token: token) }
@dwayne
dwayne / .gemrc
Last active July 28, 2021 20:04
Keep track of my setup for Ruby and Rails tools
install: --no-document # See http://guides.rubygems.org/command-reference/#gem-install
update: --no-document # See http://guides.rubygems.org/command-reference/#gem-update
:backtrace: true
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
@dwayne
dwayne / 00-ionic-notes.md
Last active October 13, 2022 15:05
My notes on the Ionic Framework.