This file contains hidden or 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
destroy: function() { | |
// Cleanup any events | |
$(this.el).undelegate(); | |
// Remove the element from the DOM | |
$(this.el).remove(); | |
return this; | |
} |
This file contains hidden or 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
// Core namespace | |
var app = app || {}; | |
app.namespace = function(namespace) { | |
var spaces = namespace.split('.'); | |
var nspace = function(spaces, index, progress) { | |
// Check the namespace exists | |
if (typeof spaces[index] === "undefined") { return; } |
This file contains hidden or 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
def some_method | |
if [email protected]? | |
goToLoginScreen | |
end | |
if [email protected]? | |
throwSomeUnathorisedError | |
end | |
#continue writing your code |
This file contains hidden or 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
def some_method | |
if @user.isLoggedIn? | |
if @user.isAdmin? | |
... | |
else | |
throwSomeUnathorisedError | |
end | |
else | |
goToLoginScreen | |
end |
This file contains hidden or 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
require 'watir-webdriver' | |
require 'test/unit' | |
require './helper_methods.rb' | |
class TKP_frontend_tests < Test::Unit::MiniTest | |
# Mixin the helper methods | |
include HelperMethods | |
This file contains hidden or 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
module HelperMethods | |
def open_browser | |
puts "Open a browser (chrome)" | |
@browser = Watir::Browser.new :chrome | |
return @browser | |
end | |
def tkp_admin_url | |
"http://frontend.example.com/admin" |
This file contains hidden or 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
<script type="text/javascript"> | |
var doc = { | |
init: function() | |
{ | |
// Setup first group | |
doc.structureTabs('#tabs'); | |
jQuery("#tabs").tabs(); | |
// Setup second group |
This file contains hidden or 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
<?php | |
public function get_record( $primary_value ) | |
{ | |
$this->db->where( $this->primary_key, $primary_value ); | |
$this->db->from( $this->table_name ); | |
$query = $this->db->get(); | |
if( $query->num_rows() === 1 ) | |
{ |
This file contains hidden or 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
<?php | |
class Users_model extends MY_Model | |
{ | |
public function __construct() | |
{ | |
parent::__construct(); | |
/* Set Table info */ |