Skip to content

Instantly share code, notes, and snippets.

it's been a long time, I shouldn't have left you...without a byebug to step thru

Tom Scott tubbo

it's been a long time, I shouldn't have left you...without a byebug to step thru
View GitHub Profile
tubbo / ports.conf
Created Apr 9, 2011
View ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz
NameVirtualHost *:80
Listen 80
View 01-generic-methods.go
package main
type Addable interface {
Total int
Add(value int) int
func (addable *Addable) Add(value int) int {
addable.Total = addable.Total + value
tubbo / 1old.js
Created Apr 4, 2020
new syntax for changing how this-binding to functions works. just an idea for now.
View 1old.js
class App {
ready() {
const app = new App()
document.addEventListener("DOMContentLoaded", app.ready.bind(app))
// or
tubbo / Dockerfile
Last active Nov 26, 2018
docker compose setup for soundstorm
View Dockerfile
# Docker image build script for Soundstorm
# Use latest Ruby
FROM ruby:2.5.3
# Install system dependencies
RUN curl -sL | bash - \
&& curl -sS | apt-key add - \
tubbo / gist:1368091
Created Nov 15, 2011
Diaspora Conversations Controller
View gist:1368091
class ConversationsController < ApplicationController
before_filter :authenticate_user!
respond_to :html, :json, :js
def index
page = params[:page]
id = params[:conversation_id]
@conversations = current_user.visible_conversations page
@visibilities = current_user.visibilities page
tubbo / polymorphic.rb
Last active Apr 13, 2017 — forked from laspluviosillas/polymorphic.rb
Issue with polymorphic associations
View polymorphic.rb
class Task < ActiveRecord::Base
has_one :notification_preference, as: :notifee
accepts_nested_attributes_for :notification_preference
class NotificationPreference < ActiveRecord::Base
belongs_to :notifee, polymorphic: true
View snippet.txt
root@tom_itt:/home/tom/src/speex# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
tubbo / pert.rb
Last active Feb 13, 2017
PERT estimation calculator
View pert.rb
#!/usr/bin/env ruby
# PERT Calculator v1.0.0
# To install, place this file in a directory that is in your $PATH. On
# my machine, I have ~/bin in my $PATH, so that's where `pert` lives.
# Example:
# $ pert 0.35 0.75 1
View Terminal
(irb):3: warning: toplevel constant Note referenced by Game::Note
=> #<Note id: nil, article_id: nil, type: nil, category: nil, body: nil, cite_url: nil, cite_title: nil, cite_website: nil, created_by_id: nil, created_at: nil, updated_at: nil>
# ^^ This is a new Note class object, not a Game::Note class object
You can’t perform that action at this time.