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
var countries = [ | |
{'name':'AFGHANISTAN', 'code':'AF'}, | |
{'name':'ÅLAND ISLANDS', 'code':'AX'}, | |
{'name':'ALBANIA', 'code':'AL'}, | |
{'name':'ALGERIA', 'code':'DZ'}, | |
{'name':'AMERICAN SAMOA', 'code':'AS'}, | |
{'name':'ANDORRA', 'code':'AD'}, | |
{'name':'ANGOLA', 'code':'AO'}, | |
{'name':'ANGUILLA', 'code':'AI'}, | |
{'name':'ANTARCTICA', 'code':'AQ'}, |
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
public function is_multi(array $array) | |
{ | |
foreach ($array as $key => $value) | |
{ | |
if (is_array($value)) | |
return TRUE; | |
} | |
return FALSE; | |
} |
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
public function find_random() | |
{ | |
$row = DB::query(Database::SELECT, | |
'SELECT * FROM `'.$this->table_name.'` ORDER BY RAND() LIMIT 1') | |
->as_object(get_class($this))->execute($this->_db)->current(); | |
return $row; | |
} |
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
window.params = (function() { | |
var obj = {}, | |
pattern = new RegExp( '([^?=&]+)=?([^&]*)?','g' ); | |
while ( match = pattern.exec( window.location.search ) ) { | |
obj[match[1]] = match[2] ? match[2] : true; | |
} | |
return obj; | |
})(); |
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
// Have jQuery? | |
if ( !Function.prototype.bind ) { | |
Function.prototype.bind = function ( obj ) { | |
args = [].slice.call( arguments ); | |
args.unshift( this ); | |
return $.proxy.apply( this, args ); | |
}; | |
} |
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
<?php | |
Class Validated extends Eloquent { | |
public $rules = array(); | |
public $errors; | |
public function __construct($attributes = array(), $exists = false) | |
{ |
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
class InvitesController < ApplicationController | |
def create | |
@project = Project.find(params[:project_id]) | |
@invite = @project.invites.build(params[:invite]) | |
if @project.save | |
redirect_to project_url(@project), :notice => 'Success message.' | |
else | |
render # ?? project/show ?? | |
end |
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
class CommentsController < ApplicationController | |
respond_to :html, :json | |
def create | |
@report = Report.find(params[:report_id]) | |
@comment = @report.comments.build(params[:comment]) | |
@comment.user = current_user | |
respond_with @report, @comment, :methods => [:by_admin?] | |
end | |
end |
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 ( $, window, document, undefined ) { | |
var pluginName = 'dealWithIt', | |
defaults = { | |
speed: 7000 | |
}; | |
function DealWithIt( element, options ) { | |
this.element = element; | |
this.options = $.extend( {}, defaults, options) ; | |
this._defaults = defaults; |
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
String::slugify = -> | |
map = | |
'à':'a' | |
'á':'a' | |
'ä':'a' | |
'â':'a' | |
'è':'e' | |
'é':'e' | |
'ë':'e' | |
'ê':'e' |
OlderNewer