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
import urllib, urllib2 | |
def getsource(pagereq): | |
user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' | |
header = {'User-Agent': user_agent} | |
req = urllib2.Request(pagereq, None, header) | |
response = urllib2.urlopen(req) | |
page = response.read() | |
return page | |
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 (a) { | |
a.browserTest = function (e, g) { | |
var f = "unknown", | |
d = "X", | |
b = function (k, j) { | |
for (var c = 0; c < j.length; c = c + 1) { | |
k = k.replace(j[c][0], j[c][1]) | |
} | |
return k | |
}, |
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
/* begin table creation */ | |
create table department | |
(dept_id smallint unsigned not null auto_increment, | |
name varchar(20) not null, | |
constraint pk_department primary key (dept_id) | |
); | |
create table branch | |
(branch_id smallint unsigned not null auto_increment, |
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
# 30 minutes Lisp in Ruby | |
# Hong MinHee <http://dahlia.kr/> | |
# | |
# This Lisp implementation does not provide a s-expression reader. | |
# Instead, it uses Ruby syntax like following code: | |
# | |
# [:def, :factorial, | |
# [:lambda, [:n], | |
# [:if, [:"=", :n, 1], | |
# 1, |
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
#include <stdio.h> | |
/* BEGIN HACKERY */ | |
typedef struct field { | |
enum { | |
TABLE_NAME, | |
TABLE_FIELD, | |
TABLE_TERMINATOR | |
} tag; |
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 | |
# Destination host machine name | |
DEST="beta.grahamg.org" | |
# User that rsync will connect as | |
# Are you sure that you want to run as root, though? | |
USER="remote_backup" | |
# Directory to copy from on the source machine. |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Backbone example</title> | |
<script type="text/javascript" src="jquery.min.js"></script> | |
<script type="text/javascript" src="underscore.js"></script> | |
<script type="text/javascript" src="backbone.js"></script> |
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
#!/usr/bin/env ruby | |
=begin | |
1) When I create a "CoffeePot" object, it should be empty and I will know this because it returns true when I ask it "coffee_pot.is_empty?", and it tells me 0 when I ask it "coffee_pot.cups_left" | |
2) When I call the "coffee_pot.fill" method it should change state to have 10 cups left in it, so when I call the "coffee_pot.cups_left" method it returns 10. If I ask "coffee_pot.is_empty?", it should return false. | |
3) every time I call the "coffee_pot.pour_cup" method, there should be one less cup remaining. | |
4) if I call "coffee_pot.pour_cup" when the pot is empty, it should raise an exception. |
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
Plesk port: 8443 | |
R1Soft CDP port: 1167 | |
cPanel port: WHM over SSL = 2087 | |
cPanel over SSL = 2083 | |
regular WHM = 2086 | |
regular cPanel = 2082 | |
feedback loop information: | |
http://www.eliteemail.com/features/email-delivery/feedback-loops/ |
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 | |
FTPU="user" # ftp login name | |
FTPP="passwd" # ftp password | |
FTPS="ftp.server.com" # remote ftp server | |
FTPF="/home/backup/" # remote ftp server directory for $FTPU & $FTPP | |
LOCALD="backup.$(date +%d.%m.%y).tgz" | |
ncftpput -m -u $FTPU -p $FTPP $FTPS $FTPF $LOCALD |
OlderNewer