Skip to content

Instantly share code, notes, and snippets.

View ModestGoblin's full-sized avatar

Thomas Sikma ModestGoblin

View GitHub Profile
cars = 100
space_in_a_car = 4.0
drivers = 30
passengers = 90
cars_not_driven = cars - drivers
cars_driven = drivers
carpool_capacity = cars_driven * space_in_a_car
average_passenger_per_car = passengers / cars_driven
puts "There are #{cars} cars available."
@ModestGoblin
ModestGoblin / SCAS.sh
Last active November 30, 2015 22:27
SCAS is a small XCode shell script which efficiently packages a Mac OS X Application's source code into the application itself. The resulting embedded project directory is fully funcitonal, allowing the code and resources to be examined, modified and re-built.
#!/bin/bash
# Source Code Access Script
set -eux
# Only bundle the source for Release/Deployment builds.
if [ "$CONFIGURATION" != 'Release' -a "$CONFIGURATION" != 'Deployment' ] ; then exit ; fi
INSIDE_SOURCE="$TARGET_BUILD_DIR"/"$CONTENTS_FOLDER_PATH"/Source
var pos_x;
var pos_y;
function myFunction(e) // called when click on image
{
$("#title").val("");
pos_x = event.offsetX?(event.offsetX):event.pageX-image.getElementById("pointer_div").offsetLeft;
pos_y = event.offsetY?(event.offsetY):event.pageY-image.getElementById("pointer_div").offsetTop;
x_pos = event.pageX;
y_pos = event.pageY;
x_pos = x_pos - 50;
function form(x_pos,y_pos){ // to create, call from myFunction()
jQuery("#someID").show();
var ele = image.getElementById('form_panel');
x_pos = x_pos - 25;
y_pos = y_pos - 80;
image.body.appendChild(form_panel);
image.getElementById('form_panel').style.width='180px';
image.getElementById('form_panel').style.height='70px';
image.getElementById('form_panel').style.background='#eee';
image.getElementById('form_panel').style.position = "absolute";
var urlOpml = "http://davewiner.com/davewiner.opml";
opmlLib.readOpmlUrl (urlOpml, function (theOutline) {
httpResponse.writeHead (200, {"Content-Type": "application/json", "Access-Control-Allow-Origin": "*"});
httpResponse.end (utils.jsonStringify (theOutline));
});