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
def handle_event("import", _params, socket) do | |
results = | |
consume_uploaded_entries(socket, :import, fn %{path: path}, _entry -> | |
temp_dir = Briefly.create!(type: :directory) | |
csv_file = Path.join(temp_dir, "import.csv") | |
# Attempt to create a new hard link to the file | |
case File.ln(path, csv_file) do | |
:ok -> | |
{:ok, csv_file} |
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
defmodule Default1710Web.FormModalLive do | |
use Default1710Web, :live_view | |
def render(assigns) do | |
~H""" | |
<.live_component module={Default1710Web.InnerForm} id="form" /> | |
<button phx-click="open_modal">Open Modal</button> | |
<.modal :if={@show_modal} id="modal" show on_cancel={JS.push("close_modal")}> |
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
[ | |
{ | |
"id": 1, | |
"address": "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts", | |
"enabled": 1, | |
"date_added": 1589393137, | |
"date_modified": 1678635720, | |
"comment": "Migrated from /etc/pihole/adlists.list", | |
"date_updated": 1696765562, | |
"number": 137890, |
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
aapas | |
abaht | |
abeat | |
abeer | |
abeng | |
abeys | |
abius | |
abjad | |
abjud | |
abnet |
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
#!/bin/bash | |
# Extend the `workon` command to include just random directories to CD into without activating | |
# a virtualenv. | |
# | |
# Source into .bashrc or .bash_profile | |
# | |
# source ~/custom_workon.sh | |
declare -A projects |
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
from django.contrib.sessions.models import Session | |
class SessionAdmin(admin.ModelAdmin): | |
list_display = ('session_key', 'decoded_session_data', 'expire_date') | |
readonly_fields = ('decoded_session_data',) | |
exclude = ('session_data',) | |
ordering = ('expire_date',) | |
search_fields = ('session_key',) | |
def decoded_session_data(self, obj): |