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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Calledin{ | |
private $ci; | |
private $messages = array( | |
0=>'Success', | |
1=>'invalid api_key', | |
2=>'no call credits', |
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
<style> | |
.scroll_checkbox { | |
border: 1px solid #CCCCCC; | |
height: 200px; | |
overflow: auto; | |
padding: 5px; | |
width: 250px; | |
} | |
</style> |
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 map_array() | |
{ | |
$names = array('Foo', 'Bar', 'Baz', 'Buzz'); | |
$tweeps = array(); | |
foreach ($names as $name) { | |
$tmp = new StdClass; | |
$tmp->name = $name; | |
$tmp->age = rand(2,7); |
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
$date = new DateTime('first Sunday'); | |
$weeksdays_array = array_map(function($val) use ($date) {return $date->add(new DateInterval('P'.$val.'D'))->format('l');}, range(0,6)); | |
var_dump($weeksdays_array); |
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
for i in `git status |grep deleted |awk '{print $3}'` ; do git rm $i; done |
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 full_languages_dropdown($id='' ) | |
{ | |
$ci = &get_instance(); | |
$ci->load->model('language_model'); | |
$common_languages = $ci->language_model->order_by('language', 'asc')->get_many_by(array('common'=>1)); | |
$languages = $ci->language_model->order_by('language', 'asc')->dropdown('id', 'language'); | |
$html = '<select id="'.$id.'" name="'.$id.'">'; |
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
// assumes you set tabIndex="0" ... last element in group | |
// set all elements in group with same class | |
// set each element with max length | |
// obviously, "phones" is not generic, easy to switch. Code I just wrote for something quick; will fix that later | |
$('.phone').keyup(function(){ | |
jumpNext($(this), $(this).val()) | |
}); |
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 | |
$main_object = new main_object(); | |
$main_object->main(); | |
class main_object{ | |
function main() | |
{ |
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
/* | |
Data starts in table: | |
ProjectId, key, value | |
1 totaltime 02:34:56 | |
1 zip.url http://www.mysite.com/download/file.zip | |
1 zip.size 12MB |
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
$date = new DateTime((date('Y')-1).'-'.date('m').'-01' ); //to kill the 31 day problem | |
$months_array = array_map(function($val) use ($date) {return $date->add(new DateInterval('P1M'))->format('M');}, range(1,12)); |
OlderNewer