Skip to content

Instantly share code, notes, and snippets.

View sirmxanot's full-sized avatar

Andrew Frank sirmxanot

  • Seattle, Washington
View GitHub Profile
def destroy
@expense = Expense.find(params[:id])
if @expense.user_id == current_user.id
@expense.destroy
flash[:success] = "You have successfully deleted the expense."
else
flash[:error] = "You can't delete expenses that you didn't create."
end
def destroy
@user = User.find(params[:id])
if @user.id == current_user.id
@user.destroy
flash[:success] = "You have successfully deleted your account."
else
flash[:error] = "You can't delete other users."
end
<% @expenses.each do |expense| %>
<tr>
<td><%= expense.id %></td>
<td><%= expense.expense_name %></td>
<td><%= expense.user_id %></td>
<td><%= expense.date_incurred %></td>
<td><%= expense.created_at %></td>
<td><%= expense.total_amount %></td>
<td><%= expense.memo %></td>
<td><%= link_to 'Show', expense %></td>
Mar 2 16:09:49 MacBook-Pro-2 osascript[268]: Initializer-based scripting additions have been deprecated. Please update this addition: "/Library/ScriptingAdditions/Adobe Unit Types.osax"
Mar 2 16:09:55 MacBook-Pro-2 osascript[269]: Initializer-based scripting additions have been deprecated. Please update this addition: "/Library/ScriptingAdditions/Adobe Unit Types.osax"
Mar 2 16:10:32 MacBook-Pro-2 mdworker[260]: (Error) SyncInfo: Catalog changed during searchfs too many times -- falling back to fsw search /
Mar 2 16:10:43 MacBook-Pro-2 WindowServer[144]: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Mar 2 16:10:43 MacBook-Pro-2 com.apple.WindowServer[144]: Fri Mar 2 16:10:43 MacBook-Pro-2.local WindowServer[144] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
This file has been truncated, but you can view the full file.
Mar 16 00:30:00 MacBook-Pro-2 newsyslog[24571]: logfile turned over
Mar 16 01:05:18 MacBook-Pro-2 com.apple.backupd[24618]: Starting standard backup
Mar 16 01:05:19 MacBook-Pro-2 com.apple.backupd[24618]: Backing up to: /Volumes/Time Machine Backups/Backups.backupdb
Mar 16 01:05:27 MacBook-Pro-2 com.apple.backupd[24618]: No pre-backup thinning needed: 1.23 GB requested (including padding), 5.45 GB available
Mar 16 01:05:31 MacBook-Pro-2 com.apple.backupd[24618]: Copied 858 files (1.4 MB) from volume Fat Freddie.
Mar 16 01:05:31 MacBook-Pro-2 com.apple.backupd[24618]: Starting post-backup thinning
Mar 16 01:05:31 MacBook-Pro-2 com.apple.backupd[24618]: No post-back up thinning needed: no expired backups exist
Mar 16 01:05:32 MacBook-Pro-2 com.apple.backupd[24618]: Backup completed successfully.
Mar 16 01:40:37 MacBook-Pro-2 applepushserviced[298]: <APSCourier: 0x1004349c0>: Stream error occurred for <APSTCPStream: 0x10045c860>: Error Domain=kCFErrorDomainCFNetwork Code=2 UserInfo=0x100428b90 "The operation cou
Andrews-MacBook-Pro:~ andrewpaulfrank$
Last login: Thu Apr 26 15:07:41 on console
Andrews-MacBook-Pro:~ andrewpaulfrank$ sudo /usr/bin/gem install cinderella --no-rdoc --no-ri
Password:
Building native extensions. This could take a while...
[Version 0.7.8] test suite cleanup (eliminated some race conditions related to queue.message_count)
Building native extensions. This could take a while...
Successfully installed yajl-ruby-1.1.0
Successfully installed ipaddress-0.8.0
Successfully installed ohai-0.6.12
Last login: Thu Apr 26 22:23:49 on ttys001
login(45754,0x7fff77c00960) malloc: *** error for object 0x7f8ffbd00a20: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
[Process completed]
Last login: Thu Apr 26 22:23:49 on ttys001
login(45767,0x7fff77c00960) malloc: *** error for object 0x10e32c330: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
[Process completed]
@sirmxanot
sirmxanot / gist:3955719
Created October 25, 2012 22:00
merge sort ruby
def merge_sort(m)
#base case
if m.length <= 1
return m
else
#intialize variables
left = Array.new
right = Array.new
middle = m.length/2
@sirmxanot
sirmxanot / gist:3956132
Created October 25, 2012 23:32
merge sort ruby - the ruby way?
def merge_sort(m)
#base case
if m.length <= 1
m
#all other cases
else
#intialize variables
left = Array.new
right = Array.new
middle = m.length/2
@sirmxanot
sirmxanot / gist:3956326
Created October 26, 2012 00:31
weird error
ArgumentError: comparison of Fixnum with nil failed
from mergesort3.rb:34:in `<'
from mergesort3.rb:34:in `block in merge'
from mergesort3.rb:31:in `each'
from mergesort3.rb:31:in `merge'
from mergesort3.rb:17:in `merge_sort'
from mergesort3.rb:14:in `merge_sort'
from (irb):4
from /usr/bin/irb:12:in `<main>'