Skip to content

Instantly share code, notes, and snippets.

# How to solve a sudoku puzzle
I. Find an empty cell
* Starting at 0,0, scan the board looking for 0
* Scan is some kind of nested loop! (Outer loop looking on x axis, inner -> y axis)
* If found
* Coordinates of first found empty cell gets stored (probably in an instance variable)
* Move on II
* If not found
THINGS FOR LATER
* How do reg ex match groups work? What's with the non-interpolation interpolation? Why does the match group need to be in a string?
A la:
def hide_all_ssns(string)
string.gsub(/(\d{3})-(\d{2})-(\d{4})/, 'XXX-XX-\3' )
end
FAUN
* Why not use oAuth
* Dates / times on the session RSVP section on the Volunteer page is confusing. Better text plz.
* Headers on RSVP form look terrible
* When I signed up it took me to the account page -- what do I do next?
* Connect to Meetup should redirect back to the event index instead of to your account page
* Add some kind of flash message for "You have successfully connected your account to Meetup!"
LILLIE
* Form submit buttons need any style whatsoever
* Anyone can have a workshop. The materials are open.
Front End 101
* Totally new to HTML and CSS
* Perhaps has seen it before, but not written much (if any)
* Not sure what tags, attributes, or selectors are
* <img>, <a>, and <p> are exciting and new
Front End 102
* Knows the basic idea behind HTML and has possibly written some
* New to CSS
* Perhaps has worked with a WYSIWIG editor but hasn't coded an HTML document from scratch
Git Cheat Sheet
first time:
git config --global user.name "My Name"
git config --global user.email "[email protected]"
each repo:
git init
LOCAL THINGS
@lilliealbert
lilliealbert / sendEmailCampaignTest.php
Created April 18, 2013 20:57
Sending a campaign test to multiple recipients
<?php
$vr->sendEmailCampaignTest(
array(
'session_id' => $sid,
'campaign_id' => $cid,
'recipients' => array(
array(
array(
'name' => "email_address",
'value' => '[email protected]',
def factorial(n)
if n == 0
return 1
end
total = n
(n-1).times do
total = total * (n - 1)
n -= 1
end
total
@lilliealbert
lilliealbert / rpn calculator of doom
Last active December 16, 2015 00:29
computers are hard
class RPNCalculator
def evaluate(exp)
exp_array = exp.split(" ").to_a
rpn_array = []
exp_array.each do |i|
if i.match(/\d/) != nil
rpn_array << i.to_i
else
rpn_array << i
end
@lilliealbert
lilliealbert / mode
Created March 28, 2013 23:24
trying to get to a mode
def mode(array)
frequency_hash = {}
array.each do |index|
frequency_hash[index] = array.count(index)
end
# now we have a hash of { number: frequency }
puts "here's the frequency of each thing, key = number, value = frequency of that number"
puts frequency_hash