This file contains hidden or 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
namespace :operations do | |
desc 'Operations: call this from cron job to make sure the site is up and running' | |
task (:production_ping => :environment) do | |
# to set up the cron job | |
# crontab -e | |
require 'uri' | |
require 'net/http' | |
require 'net/https' |
This file contains hidden or 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
# call from a rake or cron task make sure your site is still alive | |
# Usage | |
# ======== | |
# ping = Pingy.new('https://www.example.com/login', "/login?operations=pingy", 3, 2) | |
# ping.perform | |
# puts ping.message | |
# ======== | |
# Not Included code to send the email | |
# see 'Notifier.deliver_ping_failure(@to, @message)' below | |
# ALSO: hard wired for https urls, needs a few tweaks to work with either http or https |
This file contains hidden or 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> | |
<title>Testing</title> | |
<style type="text/css" media="screen"> | |
body { | |
font-family: Verdana; | |
} | |
</style> | |
<script src="jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script> | |
<script type="text/javascript"> |
This file contains hidden or 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
<%@ Page | |
Language="C#" | |
AutoEventWireup="true" | |
CodeBehind="JavaScriptConfirm.aspx.cs" | |
Inherits="SandboxOne.JavaScriptConfirm" | |
%> | |
<!DOCTYPE...> | |
<html> | |
<head runat="server"> | |
<title>Javascript Confirm</title> |
This file contains hidden or 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
public partial class JavaScriptConfirm : System.Web.UI.Page | |
{ | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
// wire the client side onclick to TestButton4 | |
this.TestButton4.Attributes.Add("onclick", "return AreYouSure();"); | |
if(Page.IsPostBack) | |
{ | |
Response.Write |
This file contains hidden or 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
<project name="YourApp" default="do-build" xmlns="http://nant.sf.net/release/0.85-rc4/nant.xsd"> | |
<!-- Version settings --> | |
<property name="project.config" value="release" /> | |
<property name="project.version.major" value="1" /> | |
<property name="project.version.minor" value="0" /> | |
<property name="project.version.build" value="0" /> | |
<property name="tfs.server" value="http://yourTFSserver:8080/" /> | |
<property name="tfs.fullpath" value="$/yourTeamProject/someDirectory/andSoOn/" /> | |
<property name="company" value="${project::get-name()}"/> | |
<property name="project" value="${project::get-name()}"/> |
This file contains hidden or 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
public static void ScriptMain(Project project) | |
{ | |
project.Log(Level.Info, "Connect to " + project.Properties["tfs.server"]); | |
TeamFoundationServer tfs = new TeamFoundationServer(project.Properties["tfs.server"]); | |
// Get a reference to Version Control. | |
Type type = typeof(VersionControlServer); | |
VersionControlServer versionControl = (VersionControlServer)tfs.GetService(type); | |
project.Log(Level.Info, "get changesetId for " + project.Properties["tfs.fullpath"]); |
This file contains hidden or 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
public static void ScriptMain(Project project) | |
{ | |
project.Log(Level.Info, "Connect to " + project.Properties["tfs.server"]); | |
TeamFoundationServer tfs = new TeamFoundationServer(project.Properties["tfs.server"]); | |
// Get a reference to Version Control. | |
Type type = typeof(VersionControlServer); | |
VersionControlServer versionControl = (VersionControlServer)tfs.GetService(type); | |
project.Log(Level.Info, "get changesetId for " + project.Properties["tfs.fullpath"]); |
This file contains hidden or 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
/* | |
Plugin: iframe autoheight jQuery Plugin | |
Author: original code by NATHAN SMITH; converted to plugin by Jesse House | |
File: jquery.iframe-auto-height.plugin.js | |
Description: when the page loads set the height of an iframe based on the height of its contents | |
Remarks: original code from http://sonspring.com/journal/jquery-iframe-sizing | |
now made into a plugin and does not match on tag name iframe | |
TODO: github link | |
TODO: tests |
This file contains hidden or 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
last_month = Date.today.last_month # => Tue, 05 Oct 2010 | |
last_month.beginning_of_month # => Fri, 01 Oct 2010 | |
last_month.end_of_month # => Sun, 31 Oct 2010 | |
last_month.beginning_of_quarter # => Fri, 01 Oct 2010 | |
last_month.end_of_quarter # => Fri, 31 Dec 2010 |