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
/** | |
* @fileOverview Script to upload files to Mosso Cloud Files for AKAR | |
* @author Nathan L Smith | |
* @date March 18, 2009 | |
*/ | |
/*global ActiveXObject, WScript, MF, AKAR */ | |
(function () { |
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
// 1: how could you rewrite the following to make it shorter? | |
foo ? bar.doSomething(el) : bar.doSomethingElse(el); | |
// 2: what is the faulty logic in the following code? | |
var foo = 'hello'; | |
(function() { |
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
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
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 | |
import os, re | |
from os.path import join, abspath, isfile, isdir, exists, basename | |
from shutil import copyfile, copytree, rmtree | |
from time import strftime, strptime, localtime | |
from time import localtime, strftime | |
import cloudfiles | |
""" | |
Author: Brandon Woodward, RHCE |
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 | |
import os, re | |
from os.path import join, abspath, isfile, isdir, exists, basename | |
from shutil import copyfile, copytree, rmtree | |
from time import strftime, strptime, localtime | |
from time import localtime, strftime | |
import cloudfiles | |
""" | |
Author: Brandon Woodward, RHCE |
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
ree_version "1.8.7-2010.02" | |
ree_url_prefix "http://rubyforge.org/frs/download.php/71096" |
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
bash -c ' | |
if [ ! -f /usr/local/bin/chef-client ]; then | |
apt-get update | |
apt-get install -y patch wget build-essential libreadline5-dev zlib1g-dev libssl-dev | |
cd /usr/src | |
test -f ruby-enterprise-<%= Chef::Config[:ree_version] %>.tar.gz || wget --quiet --timestamping <%= Chef::Config[:ree_url_prefix] %>/ruby-enterprise-<%= Chef::Config[:ree_version] %>.tar.gz | |
test -d ruby-enterprise-<%= Chef::Config[:ree_version] %> || tar xfz ruby-enterprise-<%= Chef::Config[:ree_version] %>.tar.gz | |
cd ruby-enterprise-<%= Chef::Config[:ree_version] %> | |
test -f /usr/local/bin/ruby || ./installer --auto /usr/local | |
gem install ohai chef --no-rdoc --no-ri --no-update-sources <%= '--prerelease' if @config[:prerelease] %> |
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
bash -c ' | |
if [ ! -f /usr/local/bin/chef-client ]; then | |
apt-get update | |
apt-get install -y git-core curl build-essential binutils-doc gcc autoconf flex bison libreadline5-dev zlib1g-dev libssl-dev libxml2-dev libxslt1-dev | |
bash < <( curl -L http://bit.ly/rvm-install-system-wide ) | |
( | |
cat <<'EOP' | |
[[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" # This loads RVM into a shell session. | |
EOP | |
) > /etc/profile.d/rvm.sh |
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
var net = require("net"); | |
function echoServer (stream) { | |
stream.setEncoding("utf8"); | |
stream.on("connect", function () { | |
console.log("-- someone connected to the Node.js echo server!"); | |
}); | |
stream.on("data", function (data) { | |
stream.write(">>>you sent: " + data); | |
}); |
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 "rubygems" | |
require "eventmachine" | |
module EchoServer | |
def post_init | |
puts "-- someone connected to the EventMachine echo server!" | |
end | |
def receive_data data | |
send_data ">>>you sent: " + data |