Skip to content

Instantly share code, notes, and snippets.

/**
* @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 () {
// 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() {
@smith
smith / screening.js
Created September 29, 2010 15:09 — forked from rmurphey/screening.js
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
#!/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
#!/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
ree_version "1.8.7-2010.02"
ree_url_prefix "http://rubyforge.org/frs/download.php/71096"
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] %>
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
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);
});
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