Skip to content

Instantly share code, notes, and snippets.

sdkfjsldkfjslfjslkfjs
sd
f
sdf
sd
fsdf
@ejhayes
ejhayes / Application.cfc
Created January 21, 2011 00:40
proxyObj.cfc
component {
this.name="cloudfile";
this.setter = new cfc.settings();
function onRequestStart(){
// do nothing, except disable debugging output--sadly this isn't cfscript enabled yet, so i just wrapped it
if(StructKeyExists(url,"init")){
onApplicationStart();
}
//this.setter.disableOutput();
@ejhayes
ejhayes / bucket.cfc
Created January 28, 2011 00:24
For tracking file metadata
component {
function init(required string dsn, required string bucketName){
// set the default bucket and datasource
variables.dsn = arguments.dsn;
variables.q = new Query(datasource=variables.dsn);
variables.storage = ExpandPath("./storage");
// set the default bucket
setBucket(arguments.bucketName);
}
@ejhayes
ejhayes / gist:829979
Created February 16, 2011 19:29
Application.cfc
We couldn’t find that file to show.
@ejhayes
ejhayes / Application.cfc
Created February 22, 2011 21:10
Create a CFC from a binary object (and even without the cfc extension).
component {
this.name = "";
// you may or may not be able to do this part, but
// the ram needs to be mapped accordingly or this
// will not work with createObject since it expects
// dot notation!
this.mappings[ "/ram" ] = "ram://";
}
@ejhayes
ejhayes / spiral.py
Created March 4, 2011 21:11
Generates the coordinates for a spiral!
"""
Displays the coordinates used to draw a circle.
Assumes top of the circle is (0,0)
- positive X = right
- positive y = down
To run on a spiral of width 3:
spiral.py -s 3
"""
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="600"
height="300"
creationComplete="initApp()">
<s:states>
<s:State name="loggedout"/>
<s:State name="loggedin"/>
@ejhayes
ejhayes / setup.sh
Created July 13, 2011 05:08
Sets up apache config for local development
#!/bin/sh
echo test
@ejhayes
ejhayes / setup.sh
Created July 13, 2011 05:10
Sets up apache config for local development
#!/bin/sh
echo setting up directories and other stuff
sudo mkdir -p /var/www && sudo mkdir -p /etc/apache2/sites-available && sudo mkdir -p /etc/apache2/sites-enabled && echo Include /etc/apache2/sites-enabled | sudo tee -a /etc/apache2/httpd.conf
echo 127.0.0.1 web0.local.fbprotege.sears.fluid.com | sudo tee -a /etc/hosts
echo 127.0.0.1 local.fbprotege.sears.fluid.com | sudo tee -a /etc/hosts
echo done!