Skip to content

Instantly share code, notes, and snippets.

@dre1080
dre1080 / 1_searchbar_live.ex
Created June 8, 2023 03:23 — forked from caspg/1_searchbar_live.ex
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
@dre1080
dre1080 / git-lfs-example.sh
Created May 30, 2023 08:08 — forked from MichaelCurrie/git-lfs-example.sh
Use git-lfs on existing repository
# Install git-lfs
# (From https://github.com/git-lfs/git-lfs/wiki/Installation)
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
# Add git-lfs to an existing repo
@dre1080
dre1080 / docker-cleanup-resources.md
Created November 9, 2020 23:18 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@dre1080
dre1080 / config.yml
Last active October 20, 2020 00:36 — forked from Surendrajat/config.yml
fusuma multitouch gesture config for elementary OS
swipe:
3:
left:
command: 'xdotool key ctrl+super+Left'
right:
command: 'xdotool key ctrl+super+Right'
up:
command: 'xdotool key ctrl+t'
threshold: 1.5
down:

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@dre1080
dre1080 / Contract Killer 3.md
Last active October 22, 2018 11:47 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@dre1080
dre1080 / docker.cadvisor.service
Last active June 6, 2018 23:14 — forked from pa-re/docker.cadvisor.service
/etc/systemd/system/docker.cadvisor.service
sudo docker create \
-v /:/rootfs:ro \
-v /var/run:/var/run:rw \
-v /sys:/sys:ro \
-v /var/lib/docker/:/var/lib/docker:ro \
-p 49876:8080 \
-m 50M \
--cpus 0.25 \
--cpuset-cpus 1 \
--name=cadvisor \
@dre1080
dre1080 / localhost-tld.md
Last active April 18, 2020 10:52 — forked from marek-saji/dev-tld.md
Configure local DNS server to serve *.localhost domains

Configure local wildcard DNS server

  1. Install Dnsmasq: sudo apt-get install dnsmasq

  2. Since Ubuntu's NetworkManager uses dnsmasq, and since that messes things up a little for us, open up /etc/NetworkManager/NetworkManager.conf and comment out (#) the line that reads dns=dnsmasq. Restart NetworkManager afterwards: sudo systemctl restart NetworkManager.

  3. Make sure Dnsmasq listens to local DNS queries by editing /etc/dnsmasq.conf, and adding the line listen-address=127.0.0.1.

@dre1080
dre1080 / burp.md
Last active October 6, 2015 22:38
How to code drunk

How to code drunk

Some people born with it, some people are self-taught on this, some people just discover how. How about a guide on how to code great software while still drunk as a cow?

Rules

  • You can add your patterns by forking this gist.
  • You must be drunk before sending a pattern.