This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://192.168.41.135:8080/solr/admin/cores?action=CREATE&name=collection2&instanceDir=/usr/local/collection2&config=/usr/local/collection2/conf/solrconfig.xml&schema=/usr/local/collection2/conf/schema.xml&dataDir=/usr/local/collection2/data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
has_and_belongs_to_many :followees, class_name: 'User', foreign_key: 'follower_id', association_foreign_key: 'follow_id', :join_table => 'follows' | |
has_and_belongs_to_many :followers, class_name: 'User', foreign_key: 'follow_id', association_foreign_key: 'follower_id', :join_table => 'follows' | |
has_many :followers_comments, through: :followers, :source => :comments | |
has_many :comments | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generates a join table name from two provided table names. | |
# The names in the join table names end up in lexicographic order. | |
# | |
# join_table_name("members", "clubs") # => "clubs_members" | |
# join_table_name("members", "special_clubs") # => "members_special_clubs" | |
def join_table_name(first_table_name, second_table_name) | |
if first_table_name < second_table_name | |
join_table = "#{first_table_name}_#{second_table_name}" | |
else | |
join_table = "#{second_table_name}_#{first_table_name}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Ruby on Rails: Welcome aboard</title> | |
<script src="http://code.jquery.com/jquery-1.10.2.js"></script> | |
<script> | |
$(function() { | |
$('#input').on('input', function(e) { | |
var val = $(this).val(); | |
if(val === "") return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f | |
Module.new &Proc.new | |
end | |
M = f do | |
def self.x | |
'hello world' | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f | |
puts 'f' | |
{} | |
end | |
def g | |
puts 'g' | |
1 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>git.bachue.brewupdate</string> | |
<key>ProcessType</key> | |
<string>Background</string> | |
<key>EnvironmentVariables</key> | |
<dict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div id="editor" style="height: 500px; width: 800px">Type in a word like "will" below and press ctrl+space or alt+space to get "rhyme completion"</div> | |
<div id="commandline" style="position: absolute; bottom: 10px; height: 20px; width: 800px;"></div> | |
</body> | |
<script src="https://rawgithub.com/ajaxorg/ace-builds/master/src/ace.js" type="text/javascript" charset="utf-8"></script> | |
<script src="https://rawgithub.com/ajaxorg/ace-builds/master/src/ext-language_tools.js" type="text/javascript" charset="utf-8"></script> | |
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script> | |
<script> | |
var langTools = ace.require("ace/ext/language_tools"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require "socket" | |
require "openssl" | |
require "thread" | |
listeningPort = Integer(ARGV[0]) | |
server = TCPServer.new(listeningPort) | |
sslContext = OpenSSL::SSL::SSLContext.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func main() { | |
fmt.Printf("%d\n", int8(math.Pow(2, 10))) // => 0 | |
} |