Skip to content

Instantly share code, notes, and snippets.

@krisfoster
krisfoster / node_proxy.js
Created June 24, 2010 09:08
Node.js proxy script
var sys = require('sys'),
http = require('http');
var listen_port = 8000;
http.createServer(function (request, response) {
//sys.log(request.connection.remoteAddress + ": " + request.method + " " + request.url);
var proxy = http.createClient(80, request.headers['host'])
var proxy_request = proxy.request(request.method, request.url, request.headers);
@krisfoster
krisfoster / mailmoch.sh
Created June 9, 2011 14:58
Mock out an SMTP Mail Server - Python
#!/bin/bash
# Copied from a blog... but I have lost the link to it
HOST=localhost
PORT=25
python -m smtpd -n -c DebuggingServer ${HOST}:${PORT}
@krisfoster
krisfoster / pywebserver.sh
Created August 12, 2012 07:40
Web server - python in built
#/usr/bin/env bash
# starts the built in Python web server...
# http://effbot.org/librarybook/simplehttpserver.htm
python -m SimpleHTTPServer 8000
@krisfoster
krisfoster / gist:4492592
Created January 9, 2013 11:55
Using emacs (server) for SVN commits
Set up:
export EDITOR=emacsclient
In a running emacs:
M-x server-start
To quit editing and return control the gnuclient:
@krisfoster
krisfoster / paren_balance.sc
Last active August 29, 2015 13:57
pascal.sc
package recfun
object session {
// Balances parens...
//
def balance(chars: List[Char]): Boolean = {
import scala.annotation.tailrec
@krisfoster
krisfoster / publish.bat
Created April 10, 2014 10:38
Emacs command to run a custom org publish function - allows publishing of org site on a scheduled basis
emacs -nw -l site.el -f site-publish -kill
@krisfoster
krisfoster / web.el
Created April 23, 2014 16:16
Attempt, within emacs, to validate that a URL exists. has issues... creates too many buffers that don't get closed
;;;
;;;
;;;
(defun string/ends-with (s ending)
"return non-nil if string S ends with ENDING."
(cond ((>= (length s) (length ending))
(let ((elength (length ending)))
(string= (substring s (- 0 elength)) ending)))
(t nil)))
@krisfoster
krisfoster / site-example.el
Last active October 10, 2020 16:13
Example set-up for publishing my work notes and todo lists to a site via emacs + org.
;;
;; To run:
;; * eval the buffer
;; * M-x site-publish
;;
(require 'org-publish)
(require 'org-agenda)
;;; Org-mode export settings
@krisfoster
krisfoster / ipm-repair-workflow.py
Last active August 29, 2015 14:00
Repairing IPM Work-flow Faults (wlst script to be run from the Webcenter wlst)
connect('weblogic', '<password>', 't3://<server>:<port>')
# Lists the failed itmes in an IPM workflow queue
listIPMWorkflowFaults()
# Examples of hwo to run this script follow....
#repairIPMWorkflowFaults(startDate="2009-06-01", endDate="2009-06-02")
repairIPMWorkflowFaults(appId=30)
#repairIPMWorkflowFaults(batchId=15)
#repairIPMWorkflowFaults(startDate="2009-06-01", endDate="2009-06-02", appid=3)
sumIPMWorkflowFaults
@krisfoster
krisfoster / clear-ipm-workflow-faults.py
Created April 28, 2014 13:03
Clearing IPM Work-flow Faults (wlst script to be run from the Webcenter wlst)
connect('weblogic', '<password>', 't3://<server>:<port>')
listIPMWorkflowFaults()
# Note: you can pass params to this in order to selectively clear the errors
# Please consult the documentation to see what options are available!
# You have been warned.
clearIPMWorkflowFaults()