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
| # | |
| # Postgres Database Creation Example using Horizon | |
| # | |
| # | |
| # Setup a host alias to your FreeBSD instance. | |
| # Example host creation at https://hexdocs.pm/horizon/readme.html | |
| # | |
| $ sudo sh -c 'echo "178.156.153.23\t\tdemo-pg" >> /etc/hosts' |
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
| mix phx.new app_name | |
| cd app_name | |
| cd assets | |
| npm install tailwindcss @tailwindcss/ui postcss-import postcss-loader --save-dev | |
| npx tailwindcss init | |
| npx tailwind init tailwindcss-full.js --full | |
| # Change the app dir to your app dir! |
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
| const glob = require('glob'); | |
| const fs = require('fs'); | |
| // Locate lib/<app>_web/ to locate .l?eex files | |
| const files = fs.readdirSync('../lib/'); | |
| const appWeb = files.filter((file) => file.endsWith("_web"))[0] | |
| const searchPath = '../lib/' + appWeb + '/**/*eex' | |
| const purgecss = require('@fullhuman/postcss-purgecss')({ | |
| // Specify the paths to all of the template files in your project |
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
| const path = require('path'); | |
| const glob = require('glob'); | |
| const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
| const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | |
| const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |
| const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
| module.exports = (env, options) => ({ | |
| optimization: { | |
| minimizer: [ |
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
| [postcss] ...prod mode detected, purging css | |
| Hash: d1f9561b23eda5f7f0f9 | |
| Version: webpack 4.42.0 | |
| Time: 4017ms | |
| Built at: 03/02/2020 11:12:02 PM | |
| 1 asset | |
| Entrypoint ./js/app.js = app.js | |
| [0] multi ./js/app.js 28 bytes {0} [built] | |
| [1] ./js/app.js 493 bytes {0} [built] | |
| [2] ./css/app.css 1.36 KiB {0} [built] |
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
| iex(5)> <<"fred", ?\n>> | |
| "fred\n" | |
| iex(6)> << x, ?\n>> = "fred\n" | |
| ** (MatchError) no match of right hand side value: "fred\n" |
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 Distro.DistroCalc do | |
| use GenServer | |
| require Logger | |
| def start_link do | |
| GenServer.start_link(__MODULE__, [], name: {:global, __MODULE__}) | |
| end | |
| def add(x,y) do | |
| Logger.info "self: #{inspect Node.self}" |
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
| In mix.exs of MyApp | |
| def application do | |
| [ | |
| mod: { MyApp, [] }, | |
| applications: [ :httpoison ], | |
| env: [ | |
| account: [ company: "WIC" ] | |
| ] | |
| ] | |
| 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
| {{y,m,d},{_,_,_}} = :calendar.universal_time | |
| to_string(List.flatten(:io_lib.fwrite("~2.2.0w/~2.2.0w/~w", [m,d,y]))) |
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
| My quick notes on what I did to install Elixir on the Raspberry Pi. | |
| All the info is here, but it's a self guided tour. | |
| # Get Raspbian | |
| http://www.raspberrypi.org/downloads | |
| http://downloads.raspberrypi.org/raspbian_latest | |
| # Copy raspbian.img file to th SD Card | |
| diskutils unmountDisk /dev/disk<numberhere> |
NewerOlder