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
/**** | |
yahoo weather for 5 days ahead | |
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20WHERE%20woeid=%221047378%22%20and%20u=%22c%22&format=json | |
http://l.yimg.com/a/i/us/we/52/32.gif // 32 = weather 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
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Session extends CI_Session { | |
public function __construct($params = array()) | |
{ | |
parent::__construct($params); | |
} | |
function sess_write() |
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
var IS_ADMIN = ''; | |
document.base_url = 'http://bloodbook.digiatlb.com/'; | |
document.site_url = 'http://bloodbook.digiatlb.com/'; | |
document.scripts_url = 'http://bloodbook.digiatlb.com/scripts/'; | |
document.styles_url = 'http://bloodbook.digiatlb.com/styles/'; | |
document.uploads_url = 'http://bloodbook.digiatlb.com/uploads/'; | |
document.FB_APP_ID = '185057928349987'; | |
document.FB_PAGE_NAME = 'palangmerah'; | |
document.FB_PAGE_ID = '214889140098'; |
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 | |
$file_name = 'ilu.mp3'; | |
$extension = "mp3"; | |
$mime_type = "audio/mpeg, audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3"; | |
if(file_exists($file_name)){ | |
header('Content-type: {$mime_type}'); | |
header('Content-length: ' . filesize($file_name)); | |
header('Content-Disposition: filename="' . $file_name); | |
header('X-Pad: avoid browser bug'); |
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
//wrap code in a closure to allow use of $ | |
(function ($) { | |
AKQA.DeviceManager = (function () { | |
// Device detection | |
var isiPad = (navigator.platform.match(/iPad/i)) ? true : false, | |
isiPod = (navigator.platform.match(/iPod/i)) ? true : false, | |
isiPhone = (navigator.platform.match(/iPhone/i)) ? true : false, | |
isAndroid = (navigator.userAgent.match(/Android/i)) ? true : false, | |
isHandset = isiPhone || isiPod || isAndroid, |
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
<IfModule mod_deflate.c> | |
# force deflate for mangled headers | |
# developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ | |
<IfModule mod_setenvif.c> | |
<IfModule mod_headers.c> | |
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding | |
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding | |
</IfModule> | |
</IfModule> |
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
function readDB() | |
{ | |
$tables = $this->db->list_tables(); | |
foreach($tables as $table){ | |
$query = $this->db->field_data($table); | |
echo '<h5>'.$table.'</h5>'; | |
echo '<ul>'; | |
foreach ($query as $field) | |
{ | |
echo '<li>'.$field->name.' - '.$field->type.' '.($field->primary_key ? '- <b>primary</b>':''). '</li>'; |
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
<link rel="import" href="../cool-clock/cool-clock.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
source: http://web.archive.org/web/20090221091226/http://codeigniter.com/forums/viewthread/80958/ | |
add function to two files | |
1st file: /system/database/drivers/mysql/mysql_driver.php and perhaps file mysqli_driver.php too | |
/** | |
* ON DUPLICATE UPDATE statement | |
* | |
* Generates a platform-specific on duplicate key update string from the supplied data | |
* |
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 if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
if ( ! function_exists('tgl_indo')) | |
{ | |
function tgl_indo($tgl) | |
{ | |
$ubah = gmdate($tgl, time()+60*60*8); | |
$pecah = explode("-",$ubah); | |
$tanggal = $pecah[2]; | |
$bulan = bulan($pecah[1]); |