Skip to content

Instantly share code, notes, and snippets.

View walesmd's full-sized avatar

Michael Wales walesmd

View GitHub Profile
@walesmd
walesmd / example1.js
Created November 7, 2014 23:00
Fun Friday Challenge: Why do these two code examples work differently?
/* This example results in
* undefined is not a function
*/
doLog();
var doLog = function() {
console.log('Log!');
}

Keybase proof

I hereby claim:

  • I am walesmd on github.
  • I am walesmd (https://keybase.io/walesmd) on keybase.
  • I have a public key whose fingerprint is B810 4894 0842 8ED7 C155 9765 6F76 BD21 17ED 0D34

To claim this, I am signing this object:

@walesmd
walesmd / manager.css
Created January 21, 2009 04:45
Coded xHTML/CSS for online poker tournament manager, screenshot at http://twitpic.com/15ebp
/* Structure */
#wrapper {height:600px;margin:0 auto;overflow:hidden;width:800px;}
#blinds {float:left;margin:7px 10px;width:120px;}
#blinds li {margin:6px 0;}
#clock {float:right;margin:10px;width:640px;}
#players {float:right;margin:10px;padding:5px 10px;width:620px;}
#players table {float:left;width:400px;}
.player_actions {width:40px;}
.player_name {width:160px;}
.player_table {width:80px;}
<?php if ($user !== FALSE): ?>
<ul>
<li>Username: <?php echo $user->username; ?></li>
<li>Joined: <?php echo date('Y-m-md', $user->created_on); ?></li>
</ul>
<?php else: ?>
<p>There is no user with that username. See <?php echo anchor('users/all', 'all users'); ?>.</p>
<?php endif; ?>
<?php
class Users extends Controller {
function Users() {
parent::Controller();
$this->load->model('user');
}
function profile($username = FALSE) {
<?php
class User extends Model {
function User() {
parent::Model();
}
function get($username = FALSE) {
if ($username !== FALSE) {
<?php
function gist($atts) {
extract(shortcode_atts(array('id' => NULL), $atts));
if ($id !== NULL) {
return '<script type="text/javascript" src="http://gist.github.com/' . $id . '.js"></script>';
}
}
add_shortcode('gist', 'gist');
Page 28-29 of the Rules for Visa Merchants (http://usa.visa.com/download/merchants/rules_for_visa_merchants.pdf),
informs merchants on the process of how to finalize a Visa transaction. It states, "The final step in the card
acceptance process is to ensure that the customer signs the sales receipt and to compare that signature with the
signature on the back of the card. When signing the receipt, the customer should be within your full view, and you
should check the two signatures closely for any obvious inconsistencies in spelling or handwriting."
"Although Visa rules do not preclude merchants from asking for cardholder ID, merchants cannot make an ID a
condition of acceptance. Therefore, merchants cannot refuse to complete a purchase transaction because a
cardholder refuses to provide ID. Visa believes merchants should not ask for ID as part of their regular card
acceptance procedures."
<?php
// application/libraries/MY_Controller.php
class MY_Controller extends Controller {
var $partial = 'debug/echo';
function MY_Controller() {
parent::Controller();
$this->_get_partial();
<?php
//views/debug/echo.php
?>
<h1>Debug</h1>
<pre><?php print_r($this); ?></pre>