Skip to content

Instantly share code, notes, and snippets.

@robertpateii
robertpateii / commands.txt
Last active December 15, 2015 15:28
Windows PowerShell commands I use when switching development environments.
*Change Apache target:*
gvim C:\wamp\bin\apache\apache2.2.22\conf\httpd.conf
*Bring up Wamp:*
Start-Process "$psHome\powershell.exe" -Verb Runas -ArgumentList '-command "net stop w3svc"'
&"C:\wamp\wampmanager.exe"
*Open Browsers:*
&"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "http://127.0.0.1"
&"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "http://127.0.0.1"
@robertpateii
robertpateii / utilities.js
Created September 15, 2012 01:07
my javascript utilities file
/*####---------------------BEGIN UTIITIES---------------------####*/
/**
* check for console. if it's not present, creates a console
* object with methods that do nothing. Thus you avoid errors
* in browsers without a console.
*/
if(typeof console === "undefined") {
console = {
debug: function() { },
dir: function() { },
@robertpateii
robertpateii / import-into-evernote.vba
Created June 26, 2012 02:42
import into evernote from excel spreadsheet
Option Explicit
Sub OutputNotesXML()
Dim iRow As Long
Close #1
With ActiveSheet
'For iRow = 2 To 2
Open ThisWorkbook.Path & "\evernote-import.enex" For Output As #1
@robertpateii
robertpateii / streamDateExample.html
Last active October 2, 2015 09:18
We had a page that said "Come back in the morning for the live stream!". Obviously that text should go away when the stream starts. Unfortunately the stream starts around 3am (9am in Amsterdam). So I wrote this JavaScript to do it for me, and I'm sure I'll need this next year too.
<head>
<style type="text/css">
div#livestream {
width:560px;
margin:0 auto;
}
div#comeback {
@robertpateii
robertpateii / regus_lifesize_eloqua.js
Created March 9, 2012 20:22
This is my JavaScript for integrating the Regus "book a meeting room" form with LifeSize's marketing automation tool, Eloqua. There's nothing here you couldn't find on your own looking over the public html and js files.
// save_two() already exists. this should replace it, but currently validation happens *after* save_two() fires. this is a problem. my code assumes it's valid.
function save_two(){
var contactData = {name1: 'firstname', val1: $('#firstname').val(), name2: 'lastname', val2: $('#lastname').val(),name3: 'emailaddress', val3: $('#emailaddress').val(),name4: 'contactnumber', val4: $('#contactnumber').val(),name5: 'company', val5: $('#company').val(),name6: 'contact_country', val6: $('#contact_country').val()};
$.ajax({
url: "http://lifesize.regusonline.net/form_change_two.php",
type: "POST",
data: contactData,
async:false,
success: function(data){
}
@robertpateii
robertpateii / disable-download-buttons.html
Created October 10, 2011 21:35
javascript, css, and html I wrote to disable and enable some download buttons based on a checkbox.
<html>
<head>
<style type="text/css">
img.transparentbutton {
opacity:0.4;
filter:alpha(opacity=40); /* For IE8 and earlier */
cursor:arrow;
}
</style>
@robertpateii
robertpateii / game.coffee
Created September 9, 2011 05:16
example code from CoffeeScript by Trevor Burnham with a few errors left in of my own making.
MIN_WORD_LENGTH = 2
GRID_SIZE = 5
inRange = (x, y) ->
0 <= x < GRID_SIZE and 0 <= y < GRID_SIZE
fs = require 'fs'
owl2 = fs.readFileSync 'OWL2.txt', 'utf8'
wordList = owl2.match /^(\w+)/mg
wordList = (word for word in wordList when word.length <= GRID_SIZE)
isWord = (string) ->
string in wordList
@robertpateii
robertpateii / TapExample.cs
Created July 21, 2011 21:38
a buddy of mine, Scott, asked if tap could be done in PHP and Perl. Probably, but i wanted to write it in c#. reference - http://moonbase.rydia.net/mental/blog/programming/eavesdropping-on-expressions
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
@robertpateii
robertpateii / alsokanks.lua
Last active September 26, 2015 12:07
A script file for MUSHclient that runs an infobar customized for Armageddon Mud. see https://github.com/nickgammon/mushclient and http://www.armageddon.org.
--[[
###INSTALLATION INSTRUCTIONS###
Step 1: Save this file to your hard drive. I recommend the MushClient/Script directory.
Steps 2-4: Connect to Armageddon. Hit shift-ctrl-6 to open the scripting settings menu in mushclient. Make sure your scripting language is Lua (it's default), set your script prefix to forward slash (/), then click the browse button. Find where you downloaded this file and select it. Click OK to close the script dialogue.
Step 5: Connect to your character and send this command to Armageddon: /InstallInfobar()