Skip to content

Instantly share code, notes, and snippets.

View karim-semmoud's full-sized avatar

Karim Semmoud karim-semmoud

View GitHub Profile
@caspg
caspg / 1_searchbar_live.ex
Last active February 23, 2025 13:52
Example of real-time search bar implementation in Phoenix LiveView and Tailwind. Working example on https://travelermap.net/parks/usa
defmodule TravelerWeb.SearchbarLive do
use TravelerWeb, :live_view
alias Phoenix.LiveView.JS
alias Traveler.Places
def mount(_params, _session, socket) do
socket = assign(socket, places: [])
{:ok, socket, layout: false}
end
@jasonrudolph
jasonrudolph / gist:6057563
Last active February 20, 2025 11:03
GitHub Search API: Get the number of stars for a repository

James Sugrue [asked][1], "@GitHubAPI is there a way to find the number of stars for a given repository?"

Example

$ curl -ni "https://api.github.com/search/repositories?q=more+useful+keyboard" -H 'Accept: application/vnd.github.preview'
{