Skip to content

Instantly share code, notes, and snippets.

# By default the behavior is:
# Primary monitor work as always and second monitor only have one and fixed workspace
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor remain as is.
# The desired behaviour is:
# Primary monitor and secondary monitor are linked workspace.
# I.e. you change to next workspace, primary monitor change to this workspace and second monitor too.
$ gconf-editor
# Look for /desktop/gnome/shell/windows/workspaces_only_on_primary and set to false
-- load required modules
http = require("socket.http") --luasocket
ltn12 = require("ltn12")
mime = require("mime")
io = require("io")
json = require("json") -- luajson
-- Create a Lua table to represent our entity to save
--- This is from our doc REST example: http://docs.kinvey.com/rest-appdata.html
jamesBond = { ["firstName"] = "James", ["lastName"] = "Bond", ["email"] = "[email protected]", ["age"] = 34 }
-- GET back the object to verify that we saved it
response = {}
save = ltn12.sink.table(response)
id = objAsTable["_id"] -- get the _id field from the object table
url = "https://baas.kinvey.com/appdata/KINVEY_APP_ID/testObjects/" .. id
h = {Authorization = "Basic " .. (mime.b64("KINVEY_APP_ID:KINVEY_APP_SECRET")), ["Content-Type"] = "application/json" }
ok, code, headers = http.request{url = url, headers = h, sink = save, redirect = true, method = "GET"}
/**
* Este script de javascript permite trabajar transparentemente solicitudes que requieren
* protección del token CSRF por medio de AJAX JQUERY.
* Esto te permitirá hacer solcitudes a web Services de Django por medio de AJAX Jquery.
* Para utilizarlo basta con integrar el archivo DjangoAjax.js en tu directorio de JS y hacer referencia a él en tus templates
* que requieren del uso de AJAX por POST o algún otro que requiera el token CSRF.
* Este script está basado en la documentación oficial de Django https://docs.djangoproject.com
*/
$(function(){