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 pageTitle = urlencode($('#profile_name').text()); | |
var currentLocation = 'us'; | |
$.getJSON('http://atlasapi.org/2.0/brands.json?title='+pageTitle+'&availableCountries='+currentLocation+'&limit=1&callback=?', | |
function(data) { | |
console.log(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
$.getJSON("http://atlasapi.org/2.0/brands.json?playlist.uri=http://www.channel4.com/programmes/4od/highlights&callback=?", | |
function(data){ | |
console.log(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
<html> | |
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script> | |
<script type="text/javascript"> | |
var addItem = function(item, i) { | |
var left = (i*200) % $("body").width(); | |
var top = Math.floor(Math.random() * 500); | |
$("<img/>").css({ position: 'absolute', left: left, top: top, opacity: 0, width: 100}).attr("src", item.thumbnail).appendTo("body").animate({ |
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
ContentQuery query = query() | |
.equalTo(Attributes.PLAYLIST_URI, "http://ref.atlasapi.org/hotness/twitter") | |
.equalTo(Attributes.ITEM_IS_LONG_FORM, true) | |
.build(); | |
List<Item> mentionedItems = client.items(query); |
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
Message msg = new MessageBuilder() | |
.withRecipientJids(jid) | |
.withBody(video.toString()) | |
.withMessageType(MessageType.CHAT).build(); | |
boolean messageSent = false; | |
if (xmpp.getPresence(jid).isAvailable()) { | |
SendResponse status = xmpp.sendMessage(msg); | |
messageSent = (status.getStatusMap().get(jid) == SendResponse.Status.SUCCESS); | |
} |
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 reg = new RegExp("^tmp"); | |
var names = db.getCollectionNames(); | |
for (var col in names) { var name = names[col]; if (name.match(reg)) { db[name].drop();} } |
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
#! /bin/sh | |
cd `dirname "$0"` | |
USER=`whoami` | |
if [ $USER != 'jetty' ] | |
then | |
sudo -u jetty $0 $@ | |
exit $? |
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 lookup = 'http://www.bbc.co.uk/programmes/p00fys8v'; | |
var i=0; | |
var c=0; | |
var containers = db.content.find({lookup: lookup}); | |
var found = null; | |
for (c=0; c<containers.length(); c++) { | |
var container = containers[c]; | |
print("Currently processing "+container._id); |
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 lookup = 'http://pressassociation.com/brands/1166'; | |
var i=0; | |
var container = db.content.findOne({lookup: lookup}); | |
print('container currently has '+container.contents.length+' items.'); | |
for (i=0; i<container.contents.length; i++) { | |
if (container.contents[i] != null && container.contents[i].specialization == 'film') { | |
print('removing episode at poisition '+i+': '+container.contents[i]._id+' - '+container.contents[i].title); | |
//eval('db.content.update({_id: container._id}, {$unset: {"contents.'+i+'": 1 }})'); |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2274799/hack.sh | sh | |
# |
OlderNewer