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 | |
# Set default paths and URLs | |
DOWNLOADS_DIR="$HOME/Downloads" | |
APPLICATIONS_DIR="$HOME/.local/bin" # More appropriate location for AppImages | |
ICON_URL="https://www.cursor.com/apple-touch-icon.png" | |
APPIMAGE_URL="https://downloads.cursor.com/production/61e99179e4080fecf9d8b92c6e2e3e00fbfb53f4/linux/x64/Cursor-0.48.9-x86_64.AppImage" | |
ICON_FILENAME="cursor-icon.png" | |
APPIMAGE_FILENAME="Cursor-0.48.9-x86_64.AppImage" | |
DESKTOP_FILE="$HOME/.local/share/applications/cursor-editor.desktop" |
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
package main | |
import ( | |
"slices" | |
"strings" | |
) | |
var alphabets = []string{ | |
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", | |
"x", "y", "z", |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
const iterations = 1000000 // Using a large number to make the difference more noticeable |
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
<h1>Food Bank Donations</h1> | |
<div id="donations"> | |
<div class="wrapper"> | |
<table> | |
<thead> | |
<tr> | |
<th class="item"> | |
<.sort_link opts={@opts} sort_by={:item}> | |
Item | |
</.sort_link> |
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 LiveViewStudioWeb.DonationsLive do | |
use LiveViewStudioWeb, :live_view | |
alias LiveViewStudio.Donations | |
import LiveViewStudioWeb.SortComponents | |
def mount(_params, _session, socket) do | |
donations = Donations.list_donations() | |
socket = |
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 LiveViewStudioWeb.SortComponents do | |
use Phoenix.Component | |
def valid_sort_by(%{"sort_by" => sort_by}) do | |
String.to_atom(sort_by) | |
end | |
def valid_sort_by(_), do: :id | |
def toggled_sort_order(opts, sort_by) do |
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
export async function charge_per_action(event: RequestEvent, | |
usage_title: string | null = null, | |
required_credit_amount = 2): Promise<MessageOut | null> { | |
if (!usage_title) { | |
usage_title = event.url.pathname; | |
} | |
try { | |
const response = await event.fetch(`$api/payout/charge/`, { | |
method: 'POST', |
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
export type MessageType = 'success' | 'error' | 'warning' | 'info'; | |
type MessageOutCommon = { | |
message_type?: MessageType | |
alias: string; | |
action_path?: string; | |
}; | |
type MessageSingle = MessageOutCommon & { | |
message: 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
### Begin automatically installed Phusion Passenger config snippet ### | |
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini; | |
passenger_ruby /usr/bin/ruby2.7; | |
### End automatically installed Phusion Passenger config snippet ### |
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
server { | |
listen 80; | |
listen [::]:80; | |
server_name _; | |
root /home/username/rails-app-name/public; | |
passenger_enabled on; | |
passenger_app_env production; |
NewerOlder