Skip to content

Instantly share code, notes, and snippets.

[LOGO]

[ADDRESS]

[PHONE]

[CONTACT EMAIL]

[DATE]

@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
@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 / 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 / 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>
=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 / 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: