Skip to content

Instantly share code, notes, and snippets.

View victw's full-sized avatar

Vicki Wilson victw

View GitHub Profile
@havenwood
havenwood / mock_monster.rb
Created June 26, 2015 16:30
Mocking a few Monsters with Minitest::Mock
require 'minitest/mock'
##
# This monster eats Symbols. Give it a Symbol and how many to eat and nom nom!
monster = Minitest::Mock.new
monster.expect :eat, :nom_nom, [Symbol, Numeric]
##
# Let's verify the monster in fact ate its Symbols:
monster.verify
@havenwood
havenwood / minitest_assertions.rb
Last active November 10, 2017 01:33
Explore Minitest::Assertions from the top level
require 'minitest'
# ##
# # Provide an incrementable `assertions` attr_accessor to use assertions
# # a la carte. Normally this would already be provided by Minitest::Runnable
# # but we want to play with assertions from the top level! \o/
module Minitest::Assertions
attr_writer :assertions
def assertions
@jendiamond
jendiamond / RailsGirlsLACoach.md
Last active July 25, 2017 03:21
Rails Girls L.A. Guide to Coaching

Rails Girls L.A. Guide to Coaching

The complete schedule for the event and the address can be found at: http://railsgirls.com/la

This account of Coaching a Study Group is a great guide for everyone to read.

The Guide (tutorial)
This is the tutorial we will go through with the students. It is not a race to get through it all. Aim for getting up to the part where it says to take a break. Anything past that point is frosting.

@jendiamond
jendiamond / 1railsgirlsla_part1_tutorial.md
Last active January 10, 2022 05:43
Rails Girls LA Guide
@ebinion
ebinion / gist:5690817
Last active March 3, 2016 17:23
Update Postgres "template1"
UPDATE pg_database SET datallowconn = TRUE where datname = 'template0';
\c template0
UPDATE pg_database SET datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UNICODE' LC_CTYPE = 'en_US.UTF-8' LC_COLLATE = 'C';
UPDATE pg_database SET datistemplate = TRUE where datname = 'template1';
\c template1
UPDATE pg_database SET datallowconn = FALSE where datname = 'template0';
@wadewegner
wadewegner / addselftosqlsysadmin.cmd
Created January 25, 2012 18:35
Script to add the current user to the sysadmin role in SQL Server
@echo off
rem
rem ****************************************************************************
rem
rem Copyright (c) Microsoft Corporation. All rights reserved.
rem This code is licensed under the Microsoft Public License.
rem THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
rem ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
rem IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
rem PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.