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
require 'redis' | |
# This is a direct port of ActiveSupport::Cache::MemCacheStore | |
# Drop this file in lib/active_support/cache/redis_store and in your env files | |
# add: | |
# | |
# config.cache_store = :redis_store | |
module ActiveSupport | |
module Cache |
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
// Service Definition | |
ServiceDefinition serviceDefinition = injector.getInstance(ServiceDefinition.class); | |
serviceDefinition | |
.producing(ServiceDefinition.Media.JSON) | |
.producing(ServiceDefinition.Media.XML) | |
.consuming(ServiceDefinition.Media.JSON) | |
.consuming(ServiceDefinition.Media.XML) | |
.withHandler(new ServiceHandler(ServiceDefinition.HttpMethod.PUT, "id", "createAddressBook")) | |
.withHandler(new ServiceHandler(ServiceDefinition.HttpMethod.GET, "id", "getAddressBook")) |
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
Client: Mac Pro OS X, 2.8Ghz Quad-Core Intel Xeon, 8 GB 1066 Mhz DDR3 | |
Server: lighttpd/1.4.26 -> Ubuntu, 2.8Ghz Duo-Core Intel Xeon, 6 1066 Mhz DDR3 | |
50 threads that does 50 requests, done 50 times. | |
Async Http Client 1.5.0 (Config http://is.gd/7rGGWU) | |
============================================================= | |
BenchmarkResult{requestsPerSecond=1578.96, threads=50, batches=50, targetRequests=125000, successfulRequests=125000, failedRequests=0, averageRequestTime=0.63ms, averageBatchTime=1583.32ms, totalBenchmarkTime=79166.03ms} | |
(last 5 runs) |
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
java.lang.Thread.State: RUNNABLE | |
at java.util.Arrays.copyOf(Arrays.java:2734) | |
at java.util.PriorityQueue.toArray(PriorityQueue.java:357) | |
at java.util.concurrent.DelayQueue.toArray(DelayQueue.java:360) | |
at java.util.concurrent.DelayQueue.iterator(DelayQueue.java:439) | |
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue$1.<init>(ScheduledThreadPoolExecutor.java:644) | |
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.iterator(ScheduledThreadPoolExecutor.java:643) | |
at java.util.concurrent.ThreadPoolExecutor.drainQueue(ThreadPoolExecutor.java:1198) | |
at java.util.concurrent.ThreadPoolExecutor.shutdownNow(ThreadPoolExecutor.java:1175) | |
at java.util.concurrent.ScheduledThreadPoolExecutor.shutdownNow(ScheduledThreadPoolExecutor.java:580) |
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
Vows: http://vowsjs.org/ | |
SASS: http://sass-lang.com/ | |
SSHGuard (pretty decent layout): http://www.sshguard.net/ | |
Django Haystack: http://haystacksearch.org/ | |
twelvesouth (products not project, but still): http://www.twelvesouth.com/ |
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
# Usage: show <local-port> <subdomain> | |
function show() { | |
DOMAIN=".webhostology.com" | |
REMOTE="$2$DOMAIN" | |
ssh -tR 8080:127.0.0.1:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80:127.0.0.1:8080 localhost" | |
} |
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
#!/usr/bin/python | |
#usage python show.py <local_port> | |
''' | |
Taken from: https://gist.github.com/932137 (found in http://news.ycombinator.com/item?id=2467107 ) | |
Let's say you have a webapp running in localhost (with `manage.py runserver` in django or `ruby script.rb` in sinatra or `rails server` or whatever) and you want others to be able to see it with a public url without deploying remotely. | |
ssh provides a neat facility for that: tunneling. You set up a "tunnel" from the remote host to yours and vice-versa and then you give the remote host's url and it will send all of its requests to your local daemon. |
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
package io.tesla.issues.jira; | |
import java.nio.charset.Charset; | |
import com.google.common.io.BaseEncoding; | |
import retrofit.RequestInterceptor; | |
import retrofit.RestAdapter; | |
public class JiraService { |
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
-# Super cheapo minification! | |
-# Here's how it works: | |
-# | |
-# * The HAML below points to the minified version on production, | |
-# or prints <script> tags if not. | |
-# | |
-# * We define the route to /js/script.js ourselves. | |
-# | |
-# * Some silly caching will ensure that the minification only happens once. |
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
curl -XDELETE http://localhost:9200/ac-test | |
curl -XPUT http://localhost:9200/ac-test | |
curl -XPUT http://localhost:9200/ac-test/people/1 -d ' | |
{ | |
"firstNames" : "James Earl", | |
"lastName" : "Jones", | |
"location" : "Hollywood, CA" | |
}' | |
curl -XPUT http://localhost:9200/ac-test/people/2 -d ' |
OlderNewer