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
$f = new NumberFormatter("en", NumberFormatter::SPELLOUT); | |
echo $f->format(123456); | |
// returns "one hundred twenty-three thousand four hundred fifty-six" |
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
$bookings = $this->bookings->get_many_by(array('archive' => '!= 0', 'status' => Status::get('accepted')->id)); | |
$count = count($bookings); | |
$config['base_url'] = site_url('admin/creatives/manage'); | |
$config['uri_segment'] = 4; | |
$config['total_rows'] = $count; | |
$config['per_page'] = '20'; | |
$config['num_links'] = '10'; | |
$this->pagination->initialize($config); |
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
// View | |
$('select#sales_rep').change(function(e) { | |
$.ajax({ | |
type:'POST', | |
url:'/ajax/getSalesIds', | |
dataType:'json', | |
data:{ id:$(this).val(), token:csrf }, | |
success: function(data) { console.log(data); }, | |
error: function(XMLHttpRequest, textStatus, errorThrown) { console.log(errorThrown); } |
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
URL is: site.com/dba/contest/enter | |
{{ session:messages success="success-box" notice="notice-box" error="error-box" }} | |
{{ streams:form stream="contest" mode="new" error_start='<span class="help-inline">' error_end='</span>' }} | |
{{ form_open }} | |
{{ fields }} | |
<div class="control-group"> | |
<label class="control-label" for="{{ input_slug }}">{{ input_title }}</label> | |
<div class="controls"> | |
{{ input }}{{ error }} |
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
$post = (object)array(); | |
foreach ($this->rules as $key => $field) { | |
$post->{$field['field']} = set_value($field['field']); | |
} |
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
$post = new stdClass; | |
foreach ($this->rules as $key => $field) { | |
$post->$field['field'] = set_value($field['field']); | |
} |
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
<!--[if lt IE 9]><script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6/html5shiv.min.js"></script><![endif]--> |
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 | |
use Datum\Datum; | |
Datum::createFromFormat('Y-m-d H:s:i', $filename)->toDateTimeString(); | |
// This is in index.php. Folder structure is: | |
// .. | |
// /Datum/ | |
// index.php |
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
$(document).ready(function() { | |
$('form').submit(function(e) { | |
e.preventDefault(); | |
var fullname = $('input[name=full_name]').val(); | |
var answer = $('textarea[name=answer]').val(); | |
var email = $('input[name=email]').val(); | |
var ready = 0; |
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
server { | |
listen 80; | |
server_name ~^(?<subdomain>.+?)\.domain\.com$; | |
if (!-d /usr/share/nginx/$subdomain) { | |
return http://www.domain.com/; | |
} | |
root /usr/share/nginx/$subdomain; |