News
Home Home Contact us Contact
home News Projects Tests Files Follow manatlan on Twitter Sign in
2017/06/14 16:06

my editor "in-the" is dead

All my main websites (except this one, ibraining & manatlan.com subdomains) have been migrated to my new AppEngine Editor, codename "Aed" (like ahead). The "In-the" editor is dead. But the new one is far far far better ; logic, it's the second iteration. And I always plan to release the sources on github (need some work yet).

scratch-me a pwa for scratching, cave-pilot a pwa game, in-the for my app tests, on-the for aed's dev & units tests & tmanatlan for my finished websites.

It's pretty cool to be able to modify them thru a simple browser, anywhere in the world ;-)

Comments (View) Tags: pye
2017/05/31 18:24

No more angular ... Vuejs is better ;-)

Vuejs is really good. The more I practice, the more I like. It comes with the best features of riotJS : lightweight, speed, easy to start .. and brings better : great robustness, better ecosystem, two ways binding, event modifiers. With riotjs, you can quickly create things that can be un-maintainable (if you don't respect a guideline, because there are many ways to do a same thing ! (with great power comes great responsibility)). Vuejs is less magic, but come with a good and simple frame (I like props, data, computed, watch, methods compartments) ...

In fact, I've completely rewritten My Web Editor with VueJS ... and I plan to release it on github (need some rewriting).

Today, I've migrated all tmanatlan's things under this new web editor, here (but nothings is publically available now, but you can if you know the urls ;-) ) ! Now I can edit all theses things with the embedded web editor, just need a browser ;-)

VueJS is really robust, and apps are easier to maintain ! AngularJS will not be my main choice for quality products. The vuejs ecosystem is enough ! I will continue to use riotjs for specifics things, but VueJS will become my main tool !

EDIT: scratch-me was migrated too ;-) ... Only boy doesn't work (but like yesterday ;-)... will correct soon ;-)

Comments (View)
2017/05/08 15:40

VueJS is fun !

VueJS is fun ! It's what angular2 should be ! It takes the good ideas from angular1 and react. It's nearly the perfect framework ! And there is a nearly perfect material design UI : Vue material (not as good as material angular)

I've made a front end for my recalbox libs, which is speedier than my old one (which was in pure js ;-)

I like it, but not more than riotjs3 and its router tag. It miss single file component ! In fact, it exists (.vue), but only with nodejs/browserify ;-(.

But I will consider it for my next things, when I need a material UI (in place of angular1). Coz there aren't any good UI libs for riotjs. And VueJS is a more robust than riotjs/

Comments (View)
2017/03/19 15:13

The Recalbox is perfect

I always like retro-gaming. I've started with mame on pc, bought a dingoo a320, and 4 months ago : I bought a RaspberryPi 3b to try recalbox. It's just a linux based os for emulation, with simplicity in mind ! (and it's french project!).

It's really pleasant to play metal slug, with a ps3 gamepad ;-)

Although it's really easy to setup. It could be a pain to run some arcade games (can be hard to find compatible romsets). The simplest way is to download a ready-to-use image disk like this one "Brevit Games - Recalbox 4.0.0 Final 32GB 23 Sistemas 7000 Jogos" (you can easily find it as a torrent, google is your friend). It's a 18go zipped file which contains a 32gb image disk. But this one was made with a window [free/share]ware : imageUSB from PassMark Software ;-(. It should be really easy with a window desktop.

But it's easy to create your 32gb micro sdhc with linux. Just extract the content, and type :

sudo dd if=<fullpath_to_the_bin_file> bs=512 skip=1 of=/dev/sdX

Just replace the /dev/sdX with the path to your device, which should be unmounted ! (first time : I tried with the usb device mounted, and it fails at runtime (lot of file errors))

For info : the imageUSB's bin file is a proprietary format, but it's simple, according to this thread it just contains a 512bytes header ! So we only need to skip this block with "bs=512 skip=1".

Hope it could help someone ! (really hard to find the info, for me, so I release it)...

EDIT : It works great ! Just need to re-configure the WIFI, the gamepads, to update to the latest final (4.02). And change language to french. Regarding this compilation, there are some roms which don't work (many lynx)

Comments (View)
2017/02/08 08:11

Happy birthday iBraining

10 years since iBraining is Online !

No special events today ! No new games, no new version, although I remade it in an angular version, and got a riotjs version too. But I don't have the courage to change anything. Last year, I've made the responsive version for smart devices.

I'm not able to decide if it should go with angular or riotjs. I like riotjs, but theses last weeks I came back to angular, because I'm more productive with angular material.

Comments (View)
2017/02/01 11:04

CavePilot, finally !

Here is a playable CavePilot. It's based on my old test. It should work (with chrome or firefox) on desktop (with keys) or smart devices (with gyroscope and with chrome only)

It's Single Page Application, made with riotjs2. It's a Progressive Web App, so it can be added to home screen, and should be playable offline.

Everything was made with my online editor, in a browser, on the Paas (Platform as a Service) : Google App Engine.

I've made an android app for CavePilot. But it's just a shelf, for fun ;-). But it's a webapp, so no need to update it to get the latest release, coz I can update it whenever, with a simple browser ;-)

Regarding the game ; you should drive into caves, to reach the sun as fast as possible. It's just amazing ;-)

Levels are too simples ... so it will be harder in the future, perhaps ;-)

Comments (View)
2017/01/13 14:53

Kiss a rest api

I see a lot of things about python libs to help to make restful api, nowadays. Sure, hug is beautiful.

Last year, I've made my own lib for that. But since some months, I use this KISS way, and I'm really happy with it :

Server side, I create a HTTP POST endpoint (here with bottle):

@post("/server")
def serverEndpoint():
    try:
        datas=json.loads(request.body.read())
        c=lambda d: globals()["API_"+ d.keys()[0] ]( **d[ d.keys()[0] ] )
        return {"result":[c(i) for i in datas] if type(datas)==list else c(datas)}
    except Exception as e:
        import traceback
        return {"error":traceback.format_exc()}

Now, I can create a lot of serverside API (method which starts with 'API_'), example:

def API_add(a,b=1):
    return a+b

And client side, I call them easily, like this (here with angularjs, but likely the same with JS's fetch) :

$http.post("/server", {add: {a:12, b:42} } ).then( ... )

And better, within 1 http request, I can call multiple api too, like this :

$http.post("/server", [ {add:{a:36,b:29}} , {add:{a:27}} ] ).then( ... )

If I call one method, the result is in the "result" attribut of the response. If I call multiple, results are in a list in the "result" attribut of the response. If server side error, the traceback is in the "error" attribut of the response.

It's very useful in a lot of cases, and it's hard to make simpler !?

Comments (View)
2016/09/05 07:07

My first PWA

Here is a scratch app. Progressive Web Apps are the way to go, like I said 3 years ago, it's a different fashion. It's a lot lot better to manage the cache with a service worker than with the appcache manifest ;-).

This one doesn't use angular, neither riotjs; it's just pure javascript ;-) In an near future, "web app" won't need Cordova/phonegap to access to peripherals. All will be added as api/event thru the service worker.

Comments (View)
2016/05/17 20:23

Websocket on app engine : soon !

Big news ;-)

https://code.google.com/p/googleappengine/issues/detail?id=2535

"Thanks to everyone for your feedback. We recognize the importance of App Engine support for WebSockets[1][2] and are actively working on implementing this feature."

7 years later ;-)

Comments (View) Tags: gae
2016/01/27 21:47

FreeboxV6 Api V3 avec Python

Un peu de python, et ça vient annuler ça ;-)

Voilà une api python simple de registration et de connexion avec les API v3 de la freebox :

import urllib2,hmac,json,hashlib,time

class FbxCnx:
    def __init__(self,host="mafreebox.free.fr"):
        self.host=host

    def register(self,appid,appname,devname):
        data={"app_id": appid,"app_name": appname,"device_name": devname}
        r=self._com("login/authorize/",data)["result"]
        trackid,token=r["track_id"],r["app_token"]
        s="pending"
        while s=="pending":
            s=self._com("login/authorize/%s"%trackid)["result"]["status"]
            time.sleep(1)
        return s=="granted" and token

    def _com(self,method,data=None,headers={}):
        url = "http://"+self.host+"/api/v3/"+method
        if data: data = json.dumps(data)
        return json.loads(urllib2.urlopen(urllib2.Request(url,data,headers)).read())

    def _mksession(self):
        challenge=self._com("login/")["result"]["challenge"]
        data={
          "app_id": self.appid,
          "password": hmac.new(self.token,challenge,hashlib.sha1).hexdigest()
        }
        return self._com("login/session/",data)["result"]["session_token"]

class FbxApp(FbxCnx):
    def __init__(self,appid,token,session=None,host="mafreebox.free.fr"):
        FbxCnx.__init__(self,host)
        self.appid,self.token=appid,token
        self.session=session if session else self._mksession()

    def com(self,method,data=None):
        return self._com(method,data,{"X-Fbx-App-Auth": self.session})

    def dir(self,path='/Disque dur/'):
        return self.com( "fs/ls/" + path.encode("base64") )

Pour commencer, il suffit de registrer son appli dans la freebox, en lançant, dans son reseau local uniquement, chez soi, la commande suivante :

print "token='%s'" % FbxCnx().register("test.id","le nom de l'app","la device")

Il faut valider la registration sur l'afficheur LCD de la freebox, et garder le token !

Une fois que c'est fait; on peut attaquer les API depuis n'importe où sur le web. Si on est ailleurs que dans son sous réseau freebox, il faudra préciser l'ip public de la freebox, ainsi que sont port, dans un paramètre 'host' (faut évidemment que ça soit activé dans la config freebox).

f=FbxApp("test.id",token,host="11.22.33.44:4444")
print f.dir()

L'instance FbxApp négocie, en douce, un 'token de session'. Si on veut garder la même session, il est possible de l'obtenir (f.session), de la faire persister, et de la donner à l'instanciation, comme ceci :

session="WV+O0z1XgE4QB728uINupbQdBiKKAhKYjAX+UylmGwL2ejo6ViQkcx1tK4onQIzt"
f=FbxApp("test.id",token,session,host="11.22.33.44:4444")
print f.dir()

Il n'y a que la commande "fs/ls" d'implementer (via dir()), mais le reste est tout aussi simple ;-)

Mais on peut aussi appeler directement les API, ainsi (et voir passer des params, via un dict comme second argument):

print f.com("airmedia/receivers")

*EDIT 20/02/2017 : ça marche avec les nouvelles APIs V4, faut juste remplacer "v3" par "v4" *

Comments (View)
<< oldest newest >>

Tags

RSS Python Powered Get Ubuntu
©opyleft 2008-2019 - manatlan