Let say I have this code:-
<?php
namespace myapp/postracker;
use Guzzle\Http\Client;
class Parcel {
public function __construct($parcelNo) {
<html> | |
<head> | |
<script src="http://sipjs.com/download/sip-0.6.2.min.js"></script> | |
<script> | |
</script> | |
</head> | |
<body> | |
<input id="phoneNumber"></> | |
<button id="startCall">Call</button> | |
<button id="endCall">End</button> |
""" | |
Tail file to browser using Server Sent Events (SSE) + gevent. | |
Based on http://the.taoofmac.com/space/blog/2014/11/16/1940#python-patterns--take-two | |
Twisted+websocket implementation - https://github.com/k4ml/websocket_stdout_example | |
Requirements:- | |
sudo pip install bottle |
Let say I have this code:-
<?php
namespace myapp/postracker;
use Guzzle\Http\Client;
class Parcel {
public function __construct($parcelNo) {
<?php | |
/* | |
Plugin Name: My Widget | |
Plugin URI: http://mydomain.com | |
Description: My first widget | |
Author: Me | |
Version: 1.0 | |
Author URI: http://mydomain.com | |
Original Source: https://github.com/pommiegranit/wp-widgets/blob/master/mywidget-basic.php | |
*/ |
import requests | |
base_url = 'https://gst.customs.gov.my/TAP' | |
s = requests.session() | |
# STEP 1 | |
response = s.get('%s/GetWlbToken' % base_url) | |
print response.headers | |
token = response.headers['fast-ver-last'] |
from peewee import * | |
db = SqliteDatabase(None) | |
class BaseModel(Model): | |
class Meta: | |
database = db | |
class TGUser(BaseModel): | |
id_ = IntegerField(primary_key=True) |
<div class="frm-item" jsselect="$this"> | |
<label jscontent="$this"></label><br /> | |
<input type="text" jsvalues="value:$item[$this]"><br /> | |
</div> | |
<script> | |
jq("a.item-result").live('click', function() { | |
var itemid = jq(this).attr('itemid'); | |
var baseurl = 'proxy.php?url=http://localhost:9999/item'; | |
jq.getJSON(baseurl + '/' + itemid, function(json) { |
<?php | |
class QBuilderCondition { | |
protected $conjunction = 'AND'; | |
protected $wheres = array(); | |
public function __construct($conjunction = 'AND') { | |
$this->conjunction = $conjunction; | |
} |
<?php | |
function modulename_theme($existing, $type, $theme, $path) { | |
return array( | |
'formtemplate_horizontal' => array( | |
'arguments' => array('form' => NULL), | |
), | |
); | |
} | |
function theme_formtemplate_horizontal($form) { |
#!/usr/bin/env python | |
from optparse import OptionParser | |
from os.path import join, dirname, abspath | |
from string import Template | |
import os, sys | |
parser = OptionParser() | |
parser.add_option("-a", "--address", default="127.0.0.1", help="Server address to listen") |