This file contains hidden or 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 Noonhq.Repo.BinaryKv do | |
| @moduledoc """ | |
| Simple ecto Binary KV store in the db | |
| MIT License, Joe Noon, Copyright 2020 | |
| """ | |
| require Logger | |
| use Ecto.Schema | |
| import Ecto.Query |
This file contains hidden or 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
| i have one MainLive live_view defined in router as live "/*path", MainLive . then i created | |
| a router_live.ex which looks sort of like a normal router.ex with all the live routes, but | |
| they all point to live_components. and that router is not used in the endpoint, its purely | |
| to get the functionality with route matching and Routes.live_path etc. my MainLive | |
| handle_params does a URI.parse(url) and then Phoenix.Router.route_info(MyAppWeb.RouterLive, | |
| "GET", uri.path, uri.authority) and i come out with a route that i pass down. my MainLive | |
| render does a header/footer and in the middle something like live_component(assigns.socket, | |
| route.live_view, id: route.route, store: store) (route here is what i created in | |
| handle_params… route.live_view is the LiveComponent defined in the router_live.ex for the | |
| route that matched). ive liked how it worked out so far. i also have an “AppState” that i |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"/> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"/> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
| <link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/> | |
| </head> | |
| <body> | |
| <div id="phx_root"> |
This file contains hidden or 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 MyAppWeb.LiveView.Session do | |
| @moduledoc """ | |
| Joe Noon on 9/3/2019 | |
| LiveView does not have a direct way to change the session, but does provide a way to set flash. | |
| The application can use `put_flash(socket, :session, %{...})`, and this plug will merge that | |
| map when present into the persisted session. | |
| """ |
This file contains hidden or 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
| if defined?(PhusionPassenger) | |
| # Rails.logger is not available at the time of adding the middleware | |
| class PassengerRailsLoggerProxy | |
| def info(*args) | |
| if @logger ||= Rails.logger | |
| @logger.info(*args) | |
| end | |
| end | |
| end | |
| PhusionPassenger.require_passenger_lib 'rack/out_of_band_gc' |
This file contains hidden or 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
| # Copyright (c) 2013 Joe Noon (https://github.com/joenoon) | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| # copies of the Software, and to permit persons to whom the Software is | |
| # furnished to do so, subject to the following conditions: | |
| # | |
| # The above copyright notice and this permission notice shall be included in |
This file contains hidden or 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
| # [ UIViewController, UIView, etc. ]... | |
| [ UIViewController ].each do |klass| | |
| klass.class_eval do | |
| def self.allocWithZone(zone) | |
| super.tap do |x| | |
| p " + alloc! #{x.inspect}" | |
| end | |
| end | |
| alias_method 'old_dealloc', 'dealloc' |
This file contains hidden or 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; | |
| DROP TABLE IF EXISTS tmp_series_episodes; | |
| -- a temp table containing each episode with its cooresponding series | |
| CREATE TEMP TABLE tmp_series_episodes AS | |
| SELECT series.id series_id, | |
| series.title series_name, | |
| series.added_at series_added_at, | |
| episode.id episode_id, |
This file contains hidden or 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
| class YapModel | |
| def self.database | |
| Dispatch.once { @database = YapDatabase.alloc.initWithPath(App.documents_path + "/yap.db") } | |
| @database | |
| end | |
| def self.dbconnection | |
| Thread.current["yap_dbconnection"] ||= WeakRef.new(new_dbconnection) | |
| end |
This file contains hidden or 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
| Original http://pkgs.fedoraproject.org/cgit/htmldoc.git/plain/htmldoc-1.8.27-libpng15.patch?h=f18 | |
| From upstream 1.8 branch svn r1668 | |
| The previous libpng-1.5 conversion patch here caused corrupt PNG output | |
| on 64 bit. e.g. http://answerpot.com/showthread.php?3662601-PNG+Rendering+Problems | |
| The upstream version (below) works well. | |
| Index: htmldoc/image.cxx |
NewerOlder