View form_example.html.eex
<div class="<%= container_css() %> py-10"> | |
<div class="md:grid md:grid-cols-3 md:gap-6"> | |
<div class="md:col-span-1"> | |
<div class="px-4 sm:px-0"> | |
<h3 class="text-lg font-medium leading-6 text-gray-900">Change your name</h3> | |
</div> | |
</div> | |
<div class="mt-5 md:mt-0 md:col-span-2"> | |
<%= form_for @name_changeset, Routes.user_settings_path(@conn, :update_name), fn f -> %> | |
<div class="shadow sm:rounded-md sm:overflow-hidden"> |
View live_view.ex
defmodule AppWeb.PageLive do | |
use AppWeb, :live_view | |
alias App.Posts | |
alias App.Posts.Post | |
alias App.Votes | |
@impl true | |
def mount(_params, session, socket) do | |
socket = maybe_assign_user(session, socket) |
View gist:a274e699b88538df4b63fb66c46af663
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
View command_line.sh
mix help | |
iex -S mix phx.server # like rails c | |
h Enum => shows help for Enum | |
Dossy.Accounts.__info__(:functions) => will list functions in this module | |
mix phx.routes | |
# DATABASE | |
mix ecto.gen.migration add_weather_table | |
mix ecto.migrate |
View 0firebase_functions_cheatsheet.js
// Core | |
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(functions.config().firebase); | |
const db = admin.database(); | |
admin.auth().createUser({ | |
uid: uid, | |
displayName: displayName, | |
photoURL: photoURL |
View contacts.rb
{ | |
:alpha => "WILL L", # user.rest_alpha ? | |
:name => "Lynne Williams", # user.first_name, user.last_name | |
:leasename => "Lynne Williams", # ??? | |
:leaseshortname => "Lynne Williams", # ??? | |
:postalline1 => "27B Fisher Avenue", # user.address_line_one | |
:postalline3 => "Southport Qld 4215", # user.address_line_two | |
:tenantsuburb => "Southport", # user.suburb | |
:tenantstate => "Qld", # user.state | |
:tenantpcode => 4215, # user.postcode |
View meteor_browser_policy.js
// First install the browser policy package: | |
// meteor add browser-policy | |
BrowserPolicy.framing.disallow(); | |
BrowserPolicy.content.disallowInlineScripts(); | |
BrowserPolicy.content.disallowEval(); | |
BrowserPolicy.content.allowInlineStyles(); | |
BrowserPolicy.content.allowFontDataUrl(); | |
// Change these to whatever services your app needs access to |
View example.com.conf
server { | |
# Internet traffic will come in on port 80 | |
listen 80; | |
# Apply only to traffic heading to example.com | |
# NOTE: change to your domain name | |
server_name example.come; | |
# When things are going wrong we can check the logs | |
access_log /var/log/nginx/app.dev.access.log; |
View boot-4-cheat.txt
a - all | |
t - top | |
b - bottom | |
l - left | |
r - right | |
x - left and right | |
y - top and bottom | |
m-t = margin-top: 1em | |
m-t-md = margin-top: 1.5em |
View iframeSeek.js
// Usage: | |
// | |
// var video = videojs('video_id'); | |
// video.iframeSeek(); | |
// | |
// To start the player at 30s | |
// $iframe[0].contentWindow.postMessage('startTime:30', '*') | |
// | |
(function(window, videojs) { |
NewerOlder