Skip to content

Instantly share code, notes, and snippets.

board = [
[nil, nil, nil, nil, nil, nil, nil, nil],
['wp', 'wp', 'wp', 'wp', 'wp', 'wp', 'wp', 'wp',],
[nil, nil, nil, nil, nil, nil, nil, nil],
[nil, nil, nil, nil, nil, nil, nil, nil],
[nil, nil, nil, nil, nil, nil, nil, nil],
[nil, nil, nil, nil, nil, nil, nil, nil],
['bp', 'bp', 'bp', 'bp', 'bp', 'bp', 'bp', 'bp',],
[nil, nil, nil, nil, nil, nil, nil, nil],
]
# Looking to write an API like this.
# Before calling Something::Thing#search, there has to be an instance of Something::Connection
# There are other classes to be used that require the connection instance as well.
conn = Something::Connection.new
things = Something::Thing.search('stuff') # requires that an instance of Something::Connection exists
other = Something::Other.stuff('more') # also requires that instance exists
conn.close
# How can I save that instance in such a way that any other classes in that module will see that,
The article is titled "No Three-month Course can teach you how to code". It should be titled "No three-month course can turn you into a rock-star Software Engineer" because that's what it's actually saying.
"Student X took Course Y and in a mere three months became an amazing developer now working for SuperStartup earning a salary far above the national average."
- This sentence is misleading. It implies that Student X became an amazing dev after only 3 months of doing Course Y. That's rarely ever the case, though this sentence could be true. It's more like "Student X had a super high passion for learning, and writing code, and tried to learn on his own, but needed some help. Student X took Course Y for 3 months, then worked his ass off over the next 2 years to land a position with SuperStarup earning a salaray far above the national average. It wasn't an easy course, but was the shortest path to success." I guess adding all the extra details wouldn't have made for good reading.
"these coding crash c
describe Event::Connection do
describe 'after create', :focus do
it 'creates a new life cycle connection' do
org = create(:organization)
evt = create(:event)
connection = evt.connections.build connectable: org
LifeCycle::Connection.stub(:after_create).and_return(nil)
connection.save
Process: JavaAppLauncher [13936]
Path: /Users/USER/Downloads/TreeEditor.app/Contents/MacOS/JavaAppLauncher
Identifier: iso.TreeEditor
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: launchd [231]
Responsible: JavaAppLauncher [13936]
User ID: 501
Date/Time: 2014-05-01 09:28:54.550 -0700
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
@jwoertink
jwoertink / gist:fae441b2324e4b705297
Last active August 29, 2015 14:02
Note: using Rails 4.1.1 and jquery 1.11.0
class ItemsController < StaffController
def index
@items = Item.do_stuff
render json: 'done'
end
end
@jwoertink
jwoertink / gist:ef3eed03621d73d92fb2
Created June 12, 2014 21:00
SASS error throwing segfault in ruby
Started GET "/404" for 127.0.0.1 at 2014-06-12 14:54:17 -0600
Processing by ErrorsController#not_found as HTML
Rendered errors/not_found.html.slim within layouts/public (0.1ms)
/Users/jeremy/.rvm/gems/ruby-2.1.2@my_app/gems/sass-3.2.19/lib/sass/util/subset_map.rb:74: [BUG] Segmentation fault at 0x007fa2185e3e90
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
Understanding Associations in rails
1. Take 2 models
2. Associate them
3. Ensure database has association columns needed
4. Scope routes
5. Use the scope in your controller
Example:
class Meat
Tue Aug 12 2014 09:39:08 GMT-0700 (Pacific Daylight Time) | sip.ua | configuration parameters after validation: sip.js:36
Tue Aug 12 2014 09:39:08 GMT-0700 (Pacific Daylight Time) | sip.ua | · viaHost: "192.0.2.53" sip.js:36
Tue Aug 12 2014 09:39:08 GMT-0700 (Pacific Daylight Time) | sip.ua | · uri: sip:[email protected] sip.js:36
Tue Aug 12 2014 09:39:08 GMT-0700 (Pacific Daylight Time) | sip.ua | · wsServers: [{"ws_uri":"ws://172.16.1.56:8088/ws","sip_uri":"<sip:172.16.1.56:8088;transport=ws;lr>","weight":0,"status":0,"scheme":"WS"}] sip.js:36
Tue Aug 12 2014 09:39:08 GMT-0700 (Pacific Daylight Time) | sip.ua | · password: NOT SHOWN sip.js:36
Tue Aug 12 2014 09:39:08 GMT-0700 (Pacific Daylight Time) | sip.ua | · registerExpires: 600 sip.js:36
Tue Aug 12 2014 09:39:08 GMT-0700 (Pacific Daylight Time) | sip.ua | · register: true sip.js:36
Tue Aug 12 2014 09:39:08 GMT-0700 (Pacific Daylight Time) | sip.ua | · registrarServer: sip:172.16.1.56 sip.js:36
Tue Aug 12 2014 09:39:08 GMT-0700 (Pacific Daylight Time) |