Skip to content

Instantly share code, notes, and snippets.

View LucienLee's full-sized avatar
🦌

Lucien Lee LucienLee

🦌
View GitHub Profile
@LucienLee
LucienLee / gist:5910989
Created July 2, 2013 16:47
php array with array and something else
<?php
$v = array('a', 'b',
array('c', 'd' )
,array('e', 'f'));
foreach ($v as $values)
{
if(is_array($values)){
foreach ($values as $value)
{
var data = "exports = module.exports = {
room1: 'public',
room2: 'public',
room3: 'public'
};"
var f = new Function('var module={},exports=null;\n'+data+'\nif(typeof module.exports !== "undefined") {\nreturn module.exports;\n}\nif(null != exports) {\n return exports;\n}');
var exports = f();
function appendFb( data, userID ){
var frag = document.createDocumentFragment();
var times = 0;
for (var i = 0, max = 40; i < max ; i++) {
var friend = data[i];
$.ajax({
url: 'https://graph.facebook.com/fql?q=SELECT friend_count FROM user WHERE uid='+ friend.id,
error: function( error ){