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 phpinfo(); ?> |
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
gist: 122861 | |
for i in `find . -name "*.png"` ; do optipng -o7 $i ; done | |
gist: 122859 | |
# coding: utf-8 | |
require "rango" |
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 | |
require_once '/Users/egi/Sites/libs/adodb5/adodb.inc.php'; | |
mb_internal_encoding('UTF-8'); | |
header('Content-type: text/html; charset=UTF-8'); | |
$g_dbconn = ADONewConnection('mysql'); | |
$g_dbconn->debug = true; | |
$g_dbconn->Connect('localhost', 'root', '', 'th'); |
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 (isset($_POST['submit'])) | |
{ | |
$answers = array('founder'=>'Albus Dumbledore', 'spell'=>'Alohomora', 'friend'=>'Ginny Weasley'); | |
foreach ($answers as $question_id=>$answer) | |
{ | |
if (!isset($_POST['answers'][$question_id]) || $_POST['answers'][$question_id] != $answer) | |
{ | |
// kalo ada satu aja yang salah, langsung lempar ke sini |
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 | |
function channel_shift($channel) | |
{ | |
$tomorrow = $channel->since + 86400; | |
if (0 < channel_count(array('type'=>$channel->type, 'time'=>$tomorrow))) | |
{ | |
$aChannels = $channel->load(array('since'=>$tomorrow)); | |
foreach ($aChannels as $ch) | |
channel_shift($ch); |
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 | |
/** | |
* diketahui tanggal tertentu (dalam YYYY-mm-dd), keluarkan semua minggu yang | |
* dalam range-nya memiliki tanggal di dalam bulan berjalan. minggu dimulai dari | |
* hari senin. | |
* | |
* @author Agastiya S. Mohammad <[email protected]> | |
**/ |
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
I have the following query: | |
SELECT COUNT( DISTINCT ( brand.id )), MONTH(u.created_at) | |
FROM brand | |
LEFT JOIN brand_admin_group bag ON brand.id = bag.brand_id | |
LEFT JOIN brand_admin_group_membership bagm ON bag.id = bagm.brand_admin_group_id | |
LEFT JOIN user u ON bagm.user_id = u.id | |
GROUP BY MONTH(u.created_at) | |
Results look like this: |
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 it takes more than 10 seconds to load my pages, something is wrong) | |
Timeout 10 | |
# (Note: I can set this lower if I know other processes will need more memory under load) | |
MaxClients 40 | |
# (My site gets almost no traffic) | |
MinSpareServers 4 | |
# (My server never uses memory, so extra apache children hanging around doesnot hurt me) | |
MaxSpareServers 20 |
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
<WSSMessage xmlns="com/icare/eai/schema/evWSSGetServiceClassAIRResp"> | |
<WSSGetServiceClassAIRResp> | |
<ServiceNumber>6281450010213</ServiceNumber> | |
<Status>Success</Status> | |
<ErrorMessage/> | |
<ServiceClass> | |
<SCCode>7900</SCCode> | |
</ServiceClass> | |
</WSSGetServiceClassAIRResp> | |
</WSSMessage> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<soapenv:Envelope | |
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> | |
<soap:Header | |
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"/> | |
<soapenv:Body> | |
<get:GetSubsInfoResponse | |
xmlns:get="http://www.example.org/GetSubsInfo/"> | |
<Tid>628588190194720130507124218</Tid> | |
<Msisdn>6281519307097</Msisdn> |
OlderNewer