This file contains 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
<!-- | |
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 | |
This file contains 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
cc -c -std=c99 -pedantic -O2 -Wall -W -g -rdynamic -ggdb sds.c | |
cc -c -std=c99 -pedantic -O2 -Wall -W -g -rdynamic -ggdb zmalloc.c | |
cc -c -std=c99 -pedantic -O2 -Wall -W -g -rdynamic -ggdb lzf_c.c | |
cc -c -std=c99 -pedantic -O2 -Wall -W -g -rdynamic -ggdb lzf_d.c | |
cc -c -std=c99 -pedantic -O2 -Wall -W -g -rdynamic -ggdb pqsort.c | |
cc -c -std=c99 -pedantic -O2 -Wall -W -g -rdynamic -ggdb zipmap.c | |
cc -c -std=c99 -pedantic -O2 -Wall -W -g -rdynamic -ggdb sha1.c | |
cc -o redis-server -std=c99 -pedantic -O2 -Wall -W -lm -pthread -g -rdynamic -ggdb adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o | |
Hint: To run the test-redis.tcl script is a good idea. |
This file contains 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
$base = '/blog'; | |
define( 'DOMAIN_CURRENT_SITE', 'mysite.com' ); | |
define( 'PATH_CURRENT_SITE', '/blog/' ); | |
define( 'SITE_ID_CURRENT_SITE', 1 ); | |
define( 'BLOG_ID_CURRENT_SITE', 1 ); |
This file contains 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
test "should validate numericality" do | |
o = Object.new(:number => 'not a number') | |
assert !o.errors.empty? | |
end | |
#you can just write: | |
should validate_numericality_of(:number) |
This file contains 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
# totally pointless method we're going to test | |
def sum(a, b) | |
a + b | |
end | |
# test/unit example | |
test "2 + 2 is 4" do | |
assert_equal sum(2, 2), 4 | |
end |
This file contains 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
SELECT count(*) AS count_all FROM `transfers` WHERE ((((SELECT count(recipients.id) FROM recipients WHERE recipients.transfer_id = transfers.id) = 0) AND (`transfers`.user_id = 1 AND (`transfers`.account_id = 1))) AND (`transfers`.user_id = 1 AND (`transfers`.account_id = 1))) |
This file contains 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
# will render schedule.html.erb | |
get '/schedule' do | |
erb :schedule | |
end |
This file contains 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 build_races | |
list = teams.present? ? Team.find(teams) : Team.all | |
while list.present? do | |
# Shift off the team. | |
home = list.shift | |
# This team races everyone left. | |
list.each do |away| | |
race = races.build |
This file contains 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
local_path = nil | |
Tempfile.new("upload", '/data/nginx_tmp') do |tf| | |
local_path = tf.path | |
end | |
FileUtils.touch(local_path) |
This file contains 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
#!/bin/bash | |
export RUBY_GC_MALLOC_LIMIT=60000000 | |
export RUBY_HEAP_MIN_SLOTS=500000 | |
export RUBY_HEAP_SLOTS_INCREMENT=1 | |
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
exec "/Users/Andrew/.rvm/bin/passenger_ruby" "$@" |