# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by https://github.com/logicalparadox/backbone.iobind/blob/master/lib/sync.js | |
// Overwrite Backbone.sync method | |
Backbone.sync = function(method, model, options){ | |
// create a connection to the server | |
var ws = new WebSocket('ws://127.0.0.1:1234'); | |
// send the command in url only if the connection is opened | |
// command attribute is used in server-side. | |
ws.onopen = function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AppController extends Controller { | |
public $permissions = array( | |
'Admin' => '*', | |
'Student'=>array( | |
array('controller'=>'pages', 'action'=>'display'), | |
array('controller'=>'books', 'action'=>'*') | |
) | |
); |
Source: A Plug-in by Igor Escobar on Github.
This is a very basic guide, just to understand what's needed to set it up.
If you have any questions you can find me at https://nostr.com/8355095016fddbe31fcf1453b26f613553e9758cf2263e190eac8fd96a3d3de9
- a webserver with a domain under your control
- nostr account with private and public key setup on https://nostr.com, preferably set up with nos2x: https://github.com/fiatjaf/nos2x
Create a file that resolves to <domain>/.well-known/nostr.json, and fill it out like this (enter the name you want to use, and input your own public key, make sure its the HEX-key):
{