Skip to content

Instantly share code, notes, and snippets.

Brian Smith Lytol

Block or report user

Report or block Lytol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:138437
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
View gist:140481
$(document).ready(function(){
// Add a favicon to all links with class name favicon
//
$("a.favicon").each(function() {
this.style.paddingLeft = '25px';
this.style.background = 'transparent url(' + faviconFromLink(this) + ') no-repeat top left';
});
});
View gist:191507
exception_class: NoMethodError
controller_name: socket7
action_name: create_kid
message: "undefined method `shard_key' for nil:NilClass"
backtrace: [RAILS_ROOT]/app/models/tracker.rb:12:in `shard'
/usr/lib64/ruby/gems/1.8/gems/activerecord-distributed_mysql-adapter-0.1.0/lib/active_record/distributed_mysql_ext.rb:94:in `create_without_callbacks'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/callbacks.rb:254:in `create_without_timestamps'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/timestamp.rb:39:in `create_without_user'
[RAILS_ROOT]/vendor/plugins/userstamp/lib/userstamp.rb:36:in `create'
[RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/base.rb:1777:in `create_or_update_without_callbacks'
View gist:208803
require 'yaml'
module Rails
module App
extend self
def [](key)
config[key]
end
@Lytol
Lytol / selection_sort.scala
Created Nov 4, 2009
Selection sort implementation in Scala
View selection_sort.scala
// Inmperative version
//
def selectionSort(list: Array[Int]): Unit {
def swap(list: Array[Int], i: Int, j: Int) {
var tmp = list(i)
list(i) = list(j)
list(j) = tmp
}
var i = 0
View rake.usage
rake <options> <tasks> ...;
options = [(-T | --tasks) | (-v | --verbose)] ...;
tasks = ! [ -e .rake_compleat ] && cat .rake_compleat || rake -T | cut -f2 -d' ' | tee .rake_compleat ;
View gist:280458
[user]
email = <your-email>
name = <your-name>
[color]
diff = auto
status = auto
branch = auto
[alias]
st = status
co = checkout
View com.swig505.kestrel.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.swig505.kestrel</string>
<key>ProgramArguments</key>
<array>
<string>java</string>
<string>-jar</string>
View com.swig505.memcached.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.swig505.memcached</string>
<key>Program</key>
<string>/usr/bin/memcached</string>
<key>ProgramArguments</key>
<array>
View com.swig505.mongodb.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.swig505.mongod</string>
<key>Program</key>
<string>/usr/local/mongodb/bin/mongod</string>
<key>ProgramArguments</key>
<array>
You can’t perform that action at this time.