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
BATTAHOME=/home/battaglia | |
ENVFILE=$BATTAHOME/env.sh | |
userdata=`curl http://169.254.169.254/2007-08-29/user-data` | |
repourl=`echo "$userdata" | head -n 1` | |
envurl=`echo "$userdata" | tail -n 1` | |
echo -e "\n===> Downloading env from $envurl" | |
wget "$envurl" -O $ENVFILE |
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 | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "Please run as root" | |
exit 1 | |
fi | |
echo -en "Application name => " |
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
<html> | |
<head> | |
<style type="text/css"> | |
.box { | |
width: 200px; | |
height: 200px; | |
background-color: white; | |
border: 1px solid red; | |
position: absolute; | |
top: 100px; |
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
(function(moment, $) { | |
var cssPrefix, dayNames, template_html; | |
cssPrefix = 'pandapicker-'; | |
dayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; | |
template_html = "<table role=\"datepicker\">\n <thead>\n <tr>\n <th class=\"" + cssPrefix + "prev\" role=\"prevMonth\">«</th>\n <th class=\"" + cssPrefix + "title\" colspan=\"5\" role=\"title\"></th>\n <th class=\"" + cssPrefix + "next\" role=\"nextMonth\">»</th>\n </tr>\n <tr>\n <th>" + dayNames[0] + "</th>\n <th>" + dayNames[1] + "</th>\n <th>" + dayNames[2] + "</th>\n <th>" + dayNames[3] + "</th>\n <th>" + dayNames[4] + "</th>\n <th>" + dayNames[5] + "</th>\n <th>" + dayNames[6] + "</th>\n </tr>\n </thead>\n <tbody>\n </tbody>\n</table> "; | |
return $.fn.pandaPicker = function(options) { | |
var init, updateCalendar, | |
_this = this; | |
options = $.extend({ | |
format: 'DD-MM-YYYY' |
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
/*jshint laxcomma:true */ | |
var alphainc = function (l) { | |
if (l === '9') return 'A'; | |
if (l === 'Z') return 'a'; | |
if (l === 'z') return '0'; | |
return String.fromCharCode(l.charCodeAt(0) + 1); | |
}; | |
var strinc = function (s, i) { |
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
/*jshint browser:true, indent:2, laxcomma:true, eqnull:true */ | |
/* | |
* # Tag-Do-Publish | |
* Attach PubSub.publish to DOM Elements actions. | |
* Subscribed function get e.target as the only parameter. | |
* The event handler always do e.preventDefault(); return false; | |
* | |
* <a href="" data-publish="click:myClickTrigger">click</a> | |
* <div id="dropArea" data-publish="drop:dropHandler" data-publish-usecapture>drop your files here</a> |
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
Show hidden characters
// Compilation settings | |
// ==================== | |
// | |
// The actual magic happens in the make_pdf command | |
// I stick to the format of standard ST2 sublime-build files | |
// with minor variations. | |
// NOTE: the viewer is NOT configured from here! | |
// As of 5/24/11, it cannot be changed, but I will introduce a setting later | |
{ |
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 | |
set -e | |
set -x | |
cd ~ | |
sudo groupadd web || true | |
# system upgrade | |
sudo apt-get update |
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 | |
set -e | |
#set -x | |
echo "#####################################" | |
echo "##### PLEASE DON'T RUN DIRECTLY #####" | |
echo "#####################################" | |
echo $(date) |
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 routes = { | |
'/login': login | |
, '/admin': adminIndex | |
, '/404': function () { alert('404 not found'); router.navigate('/'); } // mandatory | |
}; | |
var router = new Router(routes); | |
router.attach(); | |
router.initial('/login', true); // Forces going to login | |