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
<?xml version="1.0"?> | |
<project basedir="." default="build"> | |
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask" classpath="lib/compiler.jar"/> | |
<target name="build" depends="combineJs"> | |
</target> | |
<target name="combineJs"> | |
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
<cffunction name="allowCrossDomainAccess" returnType="void" access="public"> | |
<cfset var stHeaders = getHttpRequestData().headers /> | |
<cfif structKeyExists( stHeaders, "Origin" ) and cgi.request_method eq "OPTIONS"> | |
<!--- | |
Preflighted requests: | |
1. browser tells us it wants to make a non-basic x-domain request. Non-basic could mean it is a PUT, or contains custom headers, or a different content-type | |
2. based on what the browser tells us it wants to do, we respond and tell it what x-domain requests we allow |
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
<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0"> | |
<cfhttpparam type="Header" name="TE" value="deflate;q=0"> |
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
<!--- | |
Mach-II - A framework for object oriented MVC web applications in CFML | |
Copyright (C) 2003-2010 GreatBizTools, LLC | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
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
<cfcomponent extends="beans.model.AbstractServiceObject" output="false" hint=""> | |
<cffunction name="init" access="public" output="false" returntype="beans.model.ConsumerDAO"> | |
<cfscript> | |
// something random to append to passwords to prevent reverse md5 lookups | |
variables.salt = "_8sh3m9cc" | |
super.init( argumentcollection: arguments ); | |
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
#!/bin/bash | |
LASTFMUSER=${1:-"default_user_name"} | |
echo $LASTFMUSER ... | |
curl -s http://www.last.fm/user/$LASTFMUSER | grep -A 1 subjectCell | sed -e 's#<[^>]*>##g' | head -n2 | tail -n1 | sed 's/^[[:space:]]*//g' | cowsay |
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
sudo su - | |
# stuff we need to build from source | |
apt-get install libpcre3-dev build-essential libssl-dev | |
# get the nginx source | |
cd /opt/ | |
wget http://nginx.org/download/nginx-0.8.54.tar.gz | |
tar -zxvf nginx* | |
# we'll put the source for nginx modules in here |
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
location / { | |
if ($request_method = 'OPTIONS') { | |
more_set_headers 'Access-Control-Allow-Origin: *'; | |
more_set_headers 'Access-Control-Allow-Methods: POST, OPTIONS'; | |
more_set_headers 'Access-Control-Max-Age: 1728000'; | |
more_set_headers 'Content-Type: text/plain; charset=UTF-8'; | |
return 200; | |
} |
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
/** | |
* Define a namespace | |
*/ | |
var your_namespace = your_namespace || {}; | |
/** | |
* logging | |
* usage: log('inside coolFunc',this,arguments); | |
* http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ | |
*/ |
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
# DO NOT RESPOND TO REQUESTS OTHER THAN yourdomain.com | |
server { | |
listen 80 default; | |
server_name _; | |
return 444; | |
} | |
# FILE UPLOADS | |
server { | |
listen 80; |
OlderNewer