Skip to content

Instantly share code, notes, and snippets.

@prologic
prologic / LearnGoIn5mins.md
Last active May 5, 2024 17:05
Learn Go in ~5mins
from readypipe import requests, starting_task, subtask, schedule, save, schedule_many, open_browser
from json import loads
from lxml import etree
import datetime
from pandas import read_csv
from requests.exceptions import ConnectTimeout
SEARCH_URL = 'https://www.fandango.com/%s_movietimes?mode=general&q=%s'
JSON_ENDPOINT = 'https://www.fandango.com/napi/theaterswithshowtimes?zipCode=%s&city=&state=&date=%s&page=1&favTheaterOnly=false&limit=10&isdesktop=true'
@skunkworker
skunkworker / append_json_column_rails_5.rb
Last active October 11, 2022 16:13
How to append to a json column array in Rails 5.
# assuming Model is your model and options is a json/jsonb column.
# This uses the Postgres json append || operator.
# And wraps the option inside an array.
# producing [{},{}] multiple hashes inside a top level json array.
# It is very important that the hash is [{}] NOT {} as not having the array on the
# outside will cause the hash to replace the contents instead of appending to them.
new_option = [{
name: option_name,
@bsedat
bsedat / Dockerfile
Last active August 8, 2023 05:56
Elixir Phoenix Umbrella App + Distillery Multistage Docker Build
FROM elixir:1.4.5 as asset-builder-mix-getter
ENV HOME=/opt/app
RUN mix do local.hex --force, local.rebar --force
# Cache elixir deps
COPY config/ $HOME/config/
COPY mix.exs mix.lock $HOME/
COPY apps/myproject_web/mix.exs $HOME/apps/myproject_web/
COPY apps/myproject_web/config/ $HOME/apps/myproject_web/config/
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 2, 2024 16:19
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@andreapavoni
andreapavoni / .deliver_config
Created May 22, 2017 08:53
Edeliver configuration to deploy a Phoenix app compiling and digesting assets locally
# MYAPP/.deliver/config
APP="<APP NAME>"
MAIN_HOST="<BUILD & PRODUCTION HOST>"
MAIN_USER="<MAIN USER FOR BUILD AND DEPLOY>"
BUILD_HOST="${MAIN_HOST}"
BUILD_USER="${MAIN_USER}"
BUILD_AT="/tmp/edeliver/${APP}/builds"
@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active April 26, 2024 11:53
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@Ch4s3
Ch4s3 / install_and_deploy_elixir_phoenix_on_centos7_rhel.md
Last active April 30, 2022 19:44
Instructions for installing Elixir 1.4, Phoenix 1.2.x, and Erlang 19+ on Centos7/RHEL and deploy with edeliver and distillery. Webpack + React + Yarn for JS

Set the environment variables

Install nano(or not if you intend to use vi)

yum install -y nano

Open ~/.profile with nano ~/.profile and add the following:

@branflake2267
branflake2267 / flutter-gource.sh
Last active March 25, 2020 15:24
Flutter gource visualization commands. Visualizing the commit history with gource.
#!/bin/sh
# gource
# https://gource.io/
# flutter
# https://github.com/flutter
# 1. clone or git pull all repos
@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs: