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
cd ## change to home directory | |
git clone [email protected]:elixir-lsp/elixir-ls.git .elixir-ls | |
cd .elixir-ls | |
mkdir release | |
mix deps.get && mix compile | |
mix elixir_ls.release -o release | |
## language server lives in | |
## ~/.elixir-ls/release/language_server.sh |
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
function parseAuthHeader(headers) | |
local authHeader = headers['Authorization'] | |
if authHeader == nil then | |
return nil | |
end | |
return string.match(authHeader, "Bearer%s(%a+)") | |
end | |
function write403Message () |
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
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
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
FROM fabiocicerchia/nginx-lua | |
COPY ./nginx.conf /etc/nginx/nginx.conf | |
RUN mkdir /etc/nginx/conf.d | |
RUN mkdir /etc/nginx/lua | |
COPY lua/. /etc/nginx/lua | |
CMD [ "nginx", "-g", "daemon off;" ] |
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
version: "3" | |
networks: | |
cluster: | |
external: false | |
services: | |
proxy: | |
build: | |
context: . |
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
f = File.stream!("Locations.csv") | |
%File.Stream{ | |
line_or_bytes: :line, | |
modes: [:raw, :read_ahead, :binary], | |
path: "Locations.csv", | |
raw: true | |
} | |
City |> Repo.all() |> Repo.preload([:county, county: [:state]]) |> Enum.map(&([&1.id, &1.county.state.id])) |> CSV.encode() |> Stream.into(f) |> Stream.run() |
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
const throttle = (func, limit) => { | |
let engaged = false; | |
return function () { | |
const args = arguments; | |
const context = this; | |
if (!engaged) { | |
func.apply(context, args); | |
engaged = true; | |
setTimeout(() => engaged = false, limit); | |
} |
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
#For Ubuntu 16.04 LTS | |
#First you need to know where google-chrome is installed. To find out run: | |
which google-chrome | |
#For my case, google-chrome is installed inside both /usr/bin/google-chrome and /usr/bin/google-chrome-stable. | |
#I decided to use the stable version. | |
#Now, list the domains that you'd like chrome to treat as secure. Make sure that you have access to the folder following --user-data-dir. I used $HOME for convenience. | |
#Run the following command: |
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 | |
#This command lists all the ruby versions available for install. Make sure the ruby version you want to install is shown on the list | |
#In this case we will be looking to install 2.3.1 | |
rbenv install --list | |
#In case the ruby version (2.3.1) you want to install is not on the list, you will have to update both the rbenv | |
#and the ruby_build/plugin repositories | |
#Run the following two commands to update the corresponding git repositories (assuming both are installed inside your home folder) |
NewerOlder