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
require 'redis' | |
$redis = Redis.new | |
GLOBAL = "counter_global" | |
def local | |
"counter_sec_#{Time.now.to_i}" | |
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
lets assume you have array or urls yes ? | |
urls.each do |url| | |
check_if_counter < 50 | |
if yes | |
spawn_thread(url) | |
else | |
sleep(2) |
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
var exec = require("child_process").execFile; | |
var Campfire = require("./node_modules/campfire").Campfire; | |
var instance = new Campfire({ | |
ssl : true, | |
token : "key", | |
account : "domain" | |
}); | |
instance.join("577834", function(error, room) { |
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/env ruby | |
# encoding: utf-8 | |
require 'amqp' | |
require 'json' | |
require 'securerandom' | |
# Example HTTP response, for AMPQ we need to use single even in outgoing | |
# { | |
# "events":[{ |
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
val params = new ConnectionParameters | |
params.setUsername("guest") | |
params.setPassword("guest") | |
params.setVirtualHost("/") | |
params.setRequestedHeartbeat(0) | |
val factory = new ConnectionFactory(params) | |
// Create a new instance of the string sender. | |
// This sender will send messages to the "mult" exchange with a | |
// routing key of "routeroute" | |
val amqp = new StringAMQPSender( |
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 ( | |
"flag" | |
"html/template" | |
"log" | |
"net/http" | |
) | |
var addr = flag.String("addr", ":1718", "http service address") // Q=17, R=18 |
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" | |
"github.com/hoisie/mustache" | |
"bytes" | |
) | |
func main(){ |
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
{-# LANGUAGE OverloadedStrings #-} | |
import Database.Redis | |
import Network.CGI | |
import qualified Data.ByteString.Char8 as BL | |
setKey conn key value = do | |
runRedis conn $ do | |
set key value |
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
{ | |
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme", | |
"font_size": 12.0, | |
"tab_size": 2, | |
"translate_tabs_to_spaces": true, | |
"trim_trailing_white_space_on_save": true | |
} |
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
module ThreeUkEncryption | |
include OpenSSL::Cipher | |
extend self |