Skip to content

Instantly share code, notes, and snippets.

View Lordnibbler's full-sized avatar

Ben Radler Lordnibbler

View GitHub Profile
puts 'Start'
numbers = []
def do_it_later(&b)
b
end
5.times do |i|
puts "adding: #{i}"
create_index GET /messages/support/warranty(.:format) messages#index │·
GET /messages/support/register(.:format) messages#index │·
GET /messages/support/exchange(.:format) messages#index │·
GET /messages/support/contact-us(.:format) messages#index │·
POST /messages(.:format) messages#create
{
"event": "serverfault",
"code": 5234,
"reason": "Disk full"
}
$ grep 29 file.log | cut -d , -f 4 |sort |uniq -c |sort -nr
@Lordnibbler
Lordnibbler / giphy.coffee
Created August 6, 2015 21:43
Hubot Giphy Coffeescript
# Commands:
# giphy <term> - Returns a randomly selected gif from a search of the giphy api for <term>
giphy =
api_key: process.env.HUBOT_GIPHY_API_KEY
api_url: 'http://api.giphy.com/v1'
search: (msg, q, callback) ->
endpoint = '/gifs/search'
class Asset < ActiveRecord::Base
acts_as_paranoid
def upload_to_s3(file)
if file
#set content_type
content_type = determine_content_type(file)
self.content_type = content_type
>> Asset.methods.sort
=> [:!, :!=, :!~, :<, :<=, :<=>, :==, :===, :=~, :>, :>=, :__callback_runner_name, :__called_from__, :__define_runner, :__id__, :__reset_runner, :__run_callback, :__send__, :__update_callbacks, :_accessible_attributes, :_accessible_attributes=, :_accessible_attributes?, :_active_authorizer, :_active_authorizer=, :_active_authorizer?, :_attr_readonly, :_attr_readonly=, :_attr_readonly?, :_commit_callbacks, :_commit_callbacks=, :_commit_callbacks?, :_create_callbacks, :_create_callbacks=, :_create_callbacks?, :_define_after_model_callback, :_define_around_model_callback, :_define_before_model_callback, :_destroy_callbacks, :_destroy_callbacks=, :_destroy_callbacks?, :_find_callbacks, :_find_callbacks=, :_find_callbacks?, :_initialize_callbacks, :_initialize_callbacks=, :_initialize_callbacks?, :_mass_assignment_sanitizer, :_mass_assignment_sanitizer=, :_mass_assignment_sanitizer?, :_metasearch_association_authorized?, :_metasearch_attribute_authorized?, :_metasearch_exclude_associations, :
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
Channel *channelToDestroy = [channels objectAtIndex:indexPath.row];
[self destroyChannelWithId:channelToDestroy.identifier];
[super.channels removeObject:channelToDestroy];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
2012-03-20 19:28:17.166 Synchronic[40928:fb03] channel: <RKObjectLoader: 0x6e8c710>
2012-03-20 19:28:17.167 Synchronic[40928:fb03] -[RKObjectLoader identifier]: unrecognized selector sent to instance 0x6e8c710
2012-03-20 19:28:17.167 Synchronic[40928:fb03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RKObjectLoader identifier]: unrecognized selector sent to instance 0x6e8c710'
*** First throw call stack:
(0x1c74022 0x1e05cd6 0x1c75cbd 0x1bdaed0 0x1bdacb2 0x3bd4 0x913c54 0x9143ce 0x8ffcbd 0x90e6f1 0x8b7d21 0x1c75e42 0x2a67679 0x2a71579 0x29f64f7 0x29f83f6 0x29f7ad0 0x1c4899e 0x1bdf640 0x1bab4c6 0x1baad84 0x1baac9b 0x204a7d8 0x204a88a 0x879626 0x2972 0x28e5)
terminate called throwing an exception
{"channels":{"78":{"id":78,"name":"Title 1","num_of_listeners":1,"created_at":"2012-03-21T04:04:36Z","updated_at":"2012-04-20T01:21:12Z"},"82":{"id":82,"name":"Title 2","num_of_listeners":1,"created_at":"2012-03-22T20:28:34Z","updated_at":"2012-04-17T04:34:07Z"}}}