Skip to content

Instantly share code, notes, and snippets.

View spolu's full-sized avatar

Stanislas Polu spolu

View GitHub Profile
@spolu
spolu / example_tlpd.php
Created June 12, 2012 18:18
Teleportd PHP Library Example
<?
include('teleportd.class.php');
$tlpd = new Teleportd('USER_KEY');
$hits = $tlpd->search(array('str' => 'tag:set_2194c1aed07f46c91762eee147557c0c702cd6d2'));
var_dump($hits);
$hit = $tlpd->get('12-06-12-165f28ad582f48f8558add3547194df157f36135');
var_dump($hit);
{
hit: {
src: "instagram",
id: "206357805503187646_1397401",
typ: "image",
dte: 1338819860588,
sha: "12-06-04-57f50c7a953e26e6fd7e8b2c3288080d83162cc8",
ver: "0.3",
lnk: "http://instagr.am/p/LdIVStpYq-",
thb: "http://distilleryimage10.instagram.com/cefdfc22ae5011e1bf341231380f8a12_5.jpg",
@spolu
spolu / detectd.html
Created June 5, 2012 15:48
Old detectd information
<table>
<tr>
<td>
<div class="final">
Discover events algorithmically detected right now!<br/>
<span class="sub">
We currently detect 1000+ events everyday.
<a id="howitworks">How it Works</a>
</span>
</div>
<html>
<body>
<div style="height: 100px; border: 1px solid green;">
header
</div>
<div style="position: absolute; min-height: 100%; width: 100%; border: 1px solid yellow;">
<div style="position: absolute; width: 20%; height: 100%; border: 1px solid blue;">
video
</div>
<div style="position: absolute; width: 80%; left: 20%; height: 400px; overflow: scroll; border: 1px solid red;">
curl -XPUT "http://gate.teleportd.com:9200/myindex/post/_mapping" -d '
{
"post" : {
"properties" : {
"loc": { "type": "geo_point",
"lat_lon": "true" },
}
}
}'
var obj = { sets: [] };
var sets = [0,1,2,3,4,5,6,7,8,9,10,11,12,13];
var from = 5;
var size = 5;
for(var i = from; (i < (from + size)) && (i < sets.length); i++) {
obj.sets.push(sets[i]);
}
console.log(obj.sets);
>$ ping detectd.teleportd.com
PING detectd.teleportd.com (198.101.193.46) 56(84) bytes of data.
64 bytes from 198.101.193.46: icmp_req=1 ttl=63 time=2639 ms
64 bytes from 198.101.193.46: icmp_req=2 ttl=63 time=2893 ms
64 bytes from 198.101.193.46: icmp_req=3 ttl=63 time=2988 ms
64 bytes from 198.101.193.46: icmp_req=4 ttl=63 time=3191 ms
64 bytes from 198.101.193.46: icmp_req=5 ttl=63 time=2892 ms
@spolu
spolu / capsule_div.html
Created May 11, 2012 09:28
Capsule Embed Code
<!-- div-based embed code to be privileged -->
<div id="tlpd"></div>
<script src="http://teleportd.com/assets/js/plugin-0.1.js"></script>
<link href="http://teleportd.com/assets/css/plugin-0.1.css" rel="stylesheet">
<script>
TL.plugin({ capsule_id: 'YOUR_CAPSULE_ID',
element_id: 'tlpd',
width: 600,
height: 400 })
S3ObjectRequest *thumbReq = [S3ObjectRequest PUTRequestForData:thumbJPEG
withBucket:@"teleportd-data"
key:[NSString stringWithFormat:@"/%d-%d/%@.jpg",
(dnow / 86400), (dnow % 86400) / 3600,
thumbSHA1, nil]];
//...
PipeMsg *thumbMsg = [PipeMsg msgWithType:PipeMsgType2w
target:[NSString stringWithFormat: @"user.%@", [Pipe user], nil]
var toto = function(spec, my) {
// ...
var do;
var that = CELL.emitter({});
// ...
do = function() {