Skip to content

Instantly share code, notes, and snippets.

View tiagoa's full-sized avatar
🌎
Working from LATAM

Tiago A. tiagoa

🌎
Working from LATAM
  • Mercatus
  • Maringá
  • 17:42 (UTC -03:00)
  • X @otiagoa
View GitHub Profile
@metasikander
metasikander / NIP-05_Simple_Guide.md
Last active February 13, 2024 20:09
A small minimal guide on setting up NIP-05 identifier on branle/nostr

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

Prerequisite

Setup static file on server

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):

{
@vinicius-stutz
vinicius-stutz / README.md
Last active May 8, 2024 19:19
Máscara p/ telefones com 8 ou 9 dígitos (jquery.mask.js)
@mrgcohen
mrgcohen / Readme.md
Last active November 9, 2022 22:17
Twitter Bootstrap Typeahead autocomplete example

Requirements

  • bootstrap with typeahead
  • jquery

Explanation

This will use bootstrap with typeahead to create an autocomplete search.

@tiagoa
tiagoa / CakePHP access control
Created October 20, 2012 20:13
A CakePHP access control implementation with a User hasMany Role schema
<?php
class AppController extends Controller {
public $permissions = array(
'Admin' => '*',
'Student'=>array(
array('controller'=>'pages', 'action'=>'display'),
array('controller'=>'books', 'action'=>'*')
)
);
@tiagoa
tiagoa / Backbone.websocket.js
Created October 13, 2012 23:34
Overwrite Backbone.sync method to persist model via WebSocket
// 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(){
@gudbergur
gudbergur / README.markdown
Created February 19, 2012 23:49
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # 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