LiveView upload directly to AWS China S3
If you just want to copy-paste this it should "just work", but you'll need to get yarn
set up. Follow the instructions at https://yarnpkg.com/getting-started/install OR just run:
npm install -g yarn
yarn set version berry
yarn install
# this should make a.yarn/
,yarn.lock
, and.pnp.js
If you want to run these outside of the context of a running phoenix server, you can also run the mix tasks, mix assets.install
and mix assets.compile
. They are a copy paste of some the CLI bits but you could abstract them out to point to a config/cmds.exs
or something if you wanted.
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 Model do | |
schema "models" do | |
field :foo, :string | |
has_many :children, Model, foreign_key: :parent_id | |
belongs_to :parent, Model, foreign_key: :parent_id | |
end | |
@doc """ | |
Recursively loads parents into the given struct until it hits nil | |
""" |
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
10 umask 002 | |
set -g fish_user_paths "/home/linuxbrew/.linuxbrew/bin" $fish_user_paths | |
source ~/.asdf/asdf.fish | |
set -g pure_color_mute yellow | |
alias '_workspace'="cd /mnt/c/Users/marwen/PATH_TO/_Workspace/" |
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
Here's how to make jQuery DataTables work with npm and webpack. DT checks for AMD compatibility first | |
which breaks when you're using CommonJS with webpack. | |
Install DT core: npm install datatables.net | |
Install a DT style: npm install datatables.net-bs (bootstrap) | |
Install the imports-loader webpack plugin: https://github.com/webpack/imports-loader#disable-amd | |
Create a loader "exception" just for DT in webpack.config.js: | |
module: { | |
loaders: [ |
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
Here's how to make jQuery DataTables work with npm and webpack. This is the simplest way I found to do it. | |
See the previous revision of this gist for a way to do it with forcing AMD to be disabled if you need that. | |
Install DT core: npm install datatables.net | |
Install a DT style: npm install datatables.net-dt | |
Then to initialize DT in your app, do this in your main entry point: | |
// you can use import or require | |
import dt from 'datatables.net'; |
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
country_codes = [ | |
%{ iso_3166_1: "AF", name: "Afghanistan" }, | |
%{ iso_3166_1: "AX", name: "Aland Islands" }, | |
%{ iso_3166_1: "AL", name: "Albania" }, | |
%{ iso_3166_1: "DZ", name: "Algeria" }, | |
%{ iso_3166_1: "AS", name: "American Samoa" }, | |
%{ iso_3166_1: "AD", name: "Andorra" }, | |
%{ iso_3166_1: "AO", name: "Angola" }, | |
%{ iso_3166_1: "AI", name: "Anguilla" }, | |
%{ iso_3166_1: "AQ", name: "Antarctica" }, |
Note: $
denotes the start of a command. Don't actually type this.
- Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
- Go to https://repo.continuum.io/archive to find the list of Anaconda releases
- Select the release you want. I have a 64-bit computer, so I chose the latest release ending in
x86_65.sh
. If I had a 32-bit computer, I'd select thex86.sh
version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I choseAnaconda3-5.2.0-Linux-x86_64.sh
. - From the terminal run
wget https://repo.continuum.io/archive/[YOUR VERSION]
. Example:$ wget https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
- Run the installation script:
$ bash Anaconda[YOUR VERSION].sh
($ bash Anaconda3-5.2.0-Linux-x86_64.sh
) - Read the license
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
diff --git a/assets/js/App.svelte b/assets/js/App.svelte | |
new file mode 100644 | |
index 0000000..221cde6 | |
--- /dev/null | |
+++ b/assets/js/App.svelte | |
@@ -0,0 +1,5 @@ | |
+<script> | |
+ export let name; | |
+</script> |
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
#set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q' | |
# Add truecolor support | |
#set-option -ga terminal-overrides ,xterm-256color:Tc"" | |
# Default terminal is 256 colors | |
set -g default-terminal "screen-256color" | |
set-option -sg escape-time 10 | |
set-option -g default-terminal "screen-256color" |
NewerOlder