Skip to content

Instantly share code, notes, and snippets.

View jcelliott's full-sized avatar

Joshua C Elliott jcelliott

View GitHub Profile

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@coryodaniel
coryodaniel / readme.md
Last active April 30, 2020 03:25
MyApp deployment operater
  • Use bonny to define a MyApp CRD and Controller
    • CRD has a few fields:
      • image
      • deployment_template
  • Define a DBMigration CRD and Controller
    • CRD has a few fields:
      • image
      • migration_template
  • The templates are ConfigMap’s
  • deployment_template is a k8s Deployment YAML manifest w/ no image set (runs ~mix run —no-halt)
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@ppope
ppope / preprocess_twitter.py
Last active May 13, 2021 14:32 — forked from tokestermw/preprocess-twitter.py
FORK: Python version of Ruby script to preprocess tweets for use in GloVe featurization http://nlp.stanford.edu/projects/glove/.
"""
preprocess-twitter.py
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)"
Script for preprocessing tweets by Romain Paulus
with small modifications by Jeffrey Pennington
with translation to Python by Motoki Wu
Translation of Ruby script to create features for GloVe vectors for Twitter data.
@danielberkompas
danielberkompas / scheduler.ex
Created October 26, 2016 17:59
A simple mix task scheduler for Elixir apps
defmodule MyApp.Scheduler do
@moduledoc """
Schedules a Mix task to be run at a given interval in milliseconds.
## Options
- `:task`: The name of the Mix task to run.
- `:args`: A list of arguments to pass to the Mix task's `run/1` function.
- `:interval`: The time interval in millisconds to rerun the task.
@jcelliott
jcelliott / deps.info.ex
Last active August 19, 2024 14:36
Mix task to list information about all dependencies
defmodule Mix.Tasks.Deps.Info do
use Mix.Task
@moduledoc """
Prints information for every dependency from Hex
"""
def run(_args) do
Mix.Project.get!
Mix.Dep.loaded([env: :prod])

#Phoenix 1.1.x to 1.2.0 Upgrade Instructions

Project Generator

To generate new projects as 1.2.0, install the new mix archive:

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

Deps

@m-ou-se
m-ou-se / replace-debian-with-arch.txt
Last active October 22, 2023 12:16
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1
@jeffweiss
jeffweiss / mix.exs
Last active December 18, 2018 23:13
Retrieving application version number in mix.exs from git describe
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app,
version: get_version,
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: Mix.compilers,
build_embedded: Mix.env == :prod,
@rothgar
rothgar / install-tmux
Last active August 19, 2024 07:37 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local