Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Radio RPi</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css"/>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
@yurtaev
yurtaev / gist:2413383
Created April 18, 2012 12:49
Support nested id's for backbone.js Model
(function(Backbone){
// Helper function to accessing nested JavaScript objects with string key
// via. http://stackoverflow.com/a/6491621
var byString = function(object, stringKey) {
stringKey = stringKey.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties
stringKey = stringKey.replace(/^\./, ''); // strip a leading dot
var a = stringKey.split('.');
while (a.length) {
var n = a.shift();
if (n in object) {
@yurtaev
yurtaev / gist:1361137
Created November 12, 2011 21:23
vkontakte: get all history messages for user (JSON)
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var id = prompt("Введите ID пользователя", "0");
var data = null;
var messages = {};
messages[id] = [];
function getHistory() {
var viewer = $("<div></div>").attr({
'id': 'viewer'