Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar
💭
If I have seen further it is only by standing on the shoulders of giants. Newton

Adrian Statescu thinkphp

💭
If I have seen further it is only by standing on the shoulders of giants. Newton
View GitHub Profile
@thinkphp
thinkphp / gist:2436254
Created April 21, 2012 09:46
Usage Subsets Service
<?php
if(isset($_GET['n'])):
$n = $_GET['n'];
else:
$n = 3;
endif;
$set = "{";
for($i=1;$i<=$n;$i++):
$set .= $i.",";
@thinkphp
thinkphp / gist:5028500
Created February 25, 2013 08:26
last.fm Badge based on CUI micro-framework, Script Loader use.js, cui.yql Client and YQL Open Data Table.
use.path("scripts/")
use(["cui","dom","yql"], function(){
var lastfm = function() {
var user = 'thinkphp',
url;
function init() {
@thinkphp
thinkphp / gist:5028509
Last active December 14, 2015 04:29
Example of using CUI Library passed as argument: dom object, event object and yql function.
;(function(dom, event, yql) {
var $ = function( id ){ return dom.select(id);};
cui.ready(function(){
var input = $("#in"),
output = $("#out");
@thinkphp
thinkphp / gist:5028538
Created February 25, 2013 08:43
last.fm client made easy with python
import urllib
import json
import logging
LASTFM_API_URL = 'http://ws.audioscrobbler.com/2.0'
API_KEY = '2993c6e15c91a2890c2f11fa95673067'
def get_recent_tracks(user):
@thinkphp
thinkphp / gist:5038692
Created February 26, 2013 14:13
lastfm plugin for cui2 AMD
define("lastfm", ["cui", "dom", "event", "yql"], function(cui, dom, event, Y ){
var _lastfm = function() {
var user = 'thinkphp',
url;
function init() {
@thinkphp
thinkphp / gist:5038708
Created February 26, 2013 14:14
require plugin lastfm for cui2 AMD Style
require(["lastfm"], function( lastfm ) {
lastfm.init().and().render()
});
@thinkphp
thinkphp / gist:5058128
Created February 28, 2013 16:49
Google Search based on CUI2 AMD and Router
require(["cui","dom","event","jsonp","router"], function(cui, dom, evt, $, app){
//show me love to the module pattern
var googlesearch = function(){
var f,
resultscontainer,
send,
q,
appid = 'B59F3913692A46D75ED39BA8F472DF267E24B611';
@thinkphp
thinkphp / gist:5058155
Created February 28, 2013 16:52
Google Search using cui.router and script loader
use.path("../src/core")
use(["cui","dom","event","jsonp","router"], function(){
//dom is available and ready to use
var dom = cui.dom,
//event is available and ready to use
event = cui.event,
@thinkphp
thinkphp / gist:5058278
Created February 28, 2013 17:05
Google Search using cuba.router
//show me love to the module pattern
var googlesearch = function(){
/* defines the vars*/
//for google form
var f,
//for div container
resultscontainer,
@thinkphp
thinkphp / gist:5070418
Created March 2, 2013 10:23
Event Delegation on CUI2 AMD Style
require(["ready","dom","delegate"], function(r, dom, d){
var ready = r.ready,
delegate = d.delegate;
ready(function(){
delegate(dom.select("#menu"), 'li a', 'click', function( e ){