Skip to content

Instantly share code, notes, and snippets.

@luk3thomas
luk3thomas / wordpress-plugin-error-resolution.md
Created December 13, 2012 19:59
A client cannot search for plugins or install plugins from the WordPress dashboard

Problem

A client cannot search for plugins or install plugins from the WordPress dashboard and Akismet will not connect to the servers. The client is on a VPS. After investigation, the error was caused becuase the server is timing out on the requtest.

In this file: /wp-admin/includes/plugin-install.php line 44

$request = wp_remote_post('http://api.wordpress.org/plugins/info/1.0/', array( 'timeout' => 15, 'body' => array('action' => $action, 'request' => serialize($args))) 

In this file:

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@luk3thomas
luk3thomas / form.html
Created February 16, 2013 02:31
form.html is the payment form. main.js is the javascript to intercept the payment form and encode the credit card. payment.php charges the card and sends out any emails.
<table class="team sponsor">
<thead>
<tr>
</tr>
</thead>
<tr>
<td>Business Name</td>
<td><input class="name" type="text" value="" name="s_name" /></td>
</tr>
<tr>
@luk3thomas
luk3thomas / data.sql
Created February 19, 2013 16:52
The initial commit is the good data. The second is the bad data.
(1,'2004-11-17 07:45:00','2004-11-17 07:45:00','2004-11-17 09:00:00','2004-11-23 00:00:00','2012-11-12 22:41:38','Notices',8,'Capacity Constraint','System Pipeline Conditions - Storage Injections','../PublicArea/NotificationDisplay.aspx?noticeId=1','Y','Y');
(2,'2004-11-23 10:57:00','2004-11-23 10:57:00','2004-11-23 09:00:00','2004-11-24 09:00:00','2012-11-12 22:41:38','Notices',8,'Capacity Constraint','Rescind System Pipeline Conditions - Storage','../PublicArea/NotificationDisplay.aspx?noticeId=2','Y','Y');
(3,'2004-12-15 10:49:00','2004-12-15 10:49:00','2005-01-01 10:49:00','2005-02-01 00:00:00','2012-11-12 22:41:38','Notices',13,'Rates and Charges','January 2005','../PublicArea/NotificationDisplay.aspx?noticeId=3','N','Y');
(4,'2004-11-15 11:03:00','2004-11-15 11:03:00','2004-12-01 11:03:00','2005-01-01 00:00:00','2012-11-12 22:41:38','Notices',13,'Rates and Charges','December 2004','../PublicArea/NotificationDisplay.aspx?noticeId=4','N','Y');
(5,'2004-10-15 11:04:00','2004-10-15 11:04:00','2004-11-01 11:
@luk3thomas
luk3thomas / address-lookup.js
Last active May 3, 2018 15:00
jQuery address lookup
;(function($, google, window, document, undefined){
var pluginName = "addressLookup",
defaults = {
"namespace": "al" ,
"input": "#address-lookup"
};
function Plugin(element, options) {
this.element = element;
@luk3thomas
luk3thomas / twitter.rb
Last active December 15, 2015 10:09
quick and dirty twitter api v 1.1
class Twitter
require 'uri'
require 'base64'
require 'open-uri'
require 'net/http'
def self.tweets count = 7
begin
data = self.parse(`curl -s -H "#{authorization("Bearer", access_token)}" "https://api.twitter.com/1.1/statuses/user_timeline.json?count=#{count}&screen_name=TEST&exclude_replies=true"`)
rescue

[LOGO]

[ADDRESS]

[PHONE]

[CONTACT EMAIL]

[DATE]

@luk3thomas
luk3thomas / setup.md
Last active January 2, 2016 23:59
Python 2.6 project
  1. Install virtualenv pip install virtualenv. Installation instructions here
  2. virtualenv -p /usr/bin/python2.6 <path/to/new/virtualenv/>
  3. pip install -r requirements.pip
@luk3thomas
luk3thomas / data.csv
Last active January 4, 2016 05:59
Weather grid
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 23 columns, instead of 11 in line 8.
CST,Max TemperatureF,Mean TemperatureF,Min TemperatureF,Max Dew PointF,MeanDew PointF,Min DewpointF,Max Humidity, Mean Humidity, Min Humidity, Max Sea Level PressureIn, Mean Sea Level PressureIn, Min Sea Level PressureIn, Max VisibilityMiles, Mean VisibilityMiles, Min VisibilityMiles, Max Wind SpeedMPH, Mean Wind SpeedMPH, Max Gust SpeedMPH,PrecipitationIn, CloudCover, Events, WindDirDegrees
2010-1-16,44,39,34,39,37,34,100,88,76,30.30,30.16,29.97,5,2,0,9,4,15,T,8,Fog,73
2010-1-17,41,37,32,36,33,30,100,90,79,30.00,29.93,29.88,10,4,0,14,9,18,0.00,7,Fog,320
2010-1-18,46,40,34,39,36,34,100,86,71,30.05,30.00,29.94,5,2,0,13,5,15,T,8,Fog,235
2010-1-19,39,36,32,36,34,31,100,93,85,30.01,29.95,29.87,4,2,0,14,7,18,0.00,8,Fog,77
2010-1-20,45,41,36,44,39,35,100,96,92,29.89,29.74,29.65,2,0,0,16,10,21,0.11,8,Fog-Rain,98
2010-1-21,43,39,35,43,38,33,100,96,92,29.79,29.63,29.53,9,2,0,16,11,20,0.29,8,Fog-Rain,34
2010-1-22,40,37,34,38,35,33,100,93,85,29.96,29.90,29.78,9,3,1,15,7,18,T,8,,21
2010-1-23,53,46,39,48,45,37,100,92,83,2
@luk3thomas
luk3thomas / data.csv
Created January 26, 2014 02:18
St. Louis temperature
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 23 columns, instead of 11 in line 8.
CST,Max TemperatureF,Mean TemperatureF,Min TemperatureF,Max Dew PointF,MeanDew PointF,Min DewpointF,Max Humidity, Mean Humidity, Min Humidity, Max Sea Level PressureIn, Mean Sea Level PressureIn, Min Sea Level PressureIn, Max VisibilityMiles, Mean VisibilityMiles, Min VisibilityMiles, Max Wind SpeedMPH, Mean Wind SpeedMPH, Max Gust SpeedMPH,PrecipitationIn, CloudCover, Events, WindDirDegrees
2010-1-16,44,39,34,39,37,34,100,88,76,30.30,30.16,29.97,5,2,0,9,4,15,T,8,Fog,73
2010-1-17,41,37,32,36,33,30,100,90,79,30.00,29.93,29.88,10,4,0,14,9,18,0.00,7,Fog,320
2010-1-18,46,40,34,39,36,34,100,86,71,30.05,30.00,29.94,5,2,0,13,5,15,T,8,Fog,235
2010-1-19,39,36,32,36,34,31,100,93,85,30.01,29.95,29.87,4,2,0,14,7,18,0.00,8,Fog,77
2010-1-20,45,41,36,44,39,35,100,96,92,29.89,29.74,29.65,2,0,0,16,10,21,0.11,8,Fog-Rain,98
2010-1-21,43,39,35,43,38,33,100,96,92,29.79,29.63,29.53,9,2,0,16,11,20,0.29,8,Fog-Rain,34
2010-1-22,40,37,34,38,35,33,100,93,85,29.96,29.90,29.78,9,3,1,15,7,18,T,8,,21
2010-1-23,53,46,39,48,45,37,100,92,83,2