Skip to content

Instantly share code, notes, and snippets.

Paul Hoffer phoffer

Block or report user

Report or block phoffer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View run phoenix on amazon linux.sh
# app deps
sudo yum install git
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel openssl-devel
# erlang
wget http://www.erlang.org/download/otp_src_19.2.tar.gz
tar -zxvf otp_src_19.2.tar.gz
@techgaun
techgaun / erlang-elixir-on-amazon-linux.md
Last active Apr 23, 2019
Running elixir 1.8.1 on amazon linux
View erlang-elixir-on-amazon-linux.md

Script

#!/bin/bash

yum install ncurses-devel openssl-devel -y
yum groupinstall "Development Tools" -y

cd /tmp
wget "http://erlang.org/download/otp_src_21.3.tar.gz" -O otp21.tar.gz
@mverzilli
mverzilli / circle.yml
Created Jun 15, 2016
CircleCI for Crystal Projects
View circle.yml
# Include this file in your project's root folder to integrate with CircleCI.
# Replace 0.18.0 with the Crystal version you're using.
dependencies:
cache_directories:
- "crystal-0.18.0-1"
pre:
- if [[ ! -e crystal-0.18.0-1 ]]; then wget https://github.com/crystal-lang/crystal/releases/download/0.18.0/crystal-0.18.0-1-linux-x86_64.tar.gz && tar xvfz crystal-0.18.0-1-linux-x86_64.tar.gz; fi
test:
pre:
- crystal-0.18.0-1/bin/crystal deps
@eikes
eikes / run phoenix on amazon linux.sh
Created Dec 28, 2015
run phoenix on amazon linux
View run phoenix on amazon linux.sh
# app deps
sudo yum install git
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel
# erlang
wget http://www.erlang.org/download/otp_src_18.1.tar.gz
tar -zxvf otp_src_18.1.tar.gz
@FND
FND / content_negotiator.ex
Last active Dec 12, 2017
Phoenix content negotiation
View content_negotiator.ex
defmodule ContentNegotiator do
def init(opts), do: opts
def call(conn, opts) do
conn
|> Phoenix.Controller.accepts(Map.keys(opts))
|> dispatch_by_accept(opts)
end
@notozeki
notozeki / Makefile
Last active Oct 9, 2018
An example Ruby extension written in Crystal
View Makefile
CRYSTAL = crystal
UNAME = "$(shell uname -ms)"
LIBRARY_PATH = $(shell brew --prefix crystal-lang)/embedded/lib
LIBS = -levent -lpcl -lpcre -lgc -lpthread
LDFLAGS = -Wl,-undefined,dynamic_lookup
TARGET = crystal_example_ext.bundle
$(TARGET): crystal_example_ext.o
$(CC) -bundle -L$(LIBRARY_PATH) -o $@ $^ $(LIBS) $(LDFLAGS)
@olivierlacan
olivierlacan / migrate_postgresql_database.md
Last active Jun 27, 2019
How to migrate a Homebrew-installed PostgreSQL database to a new major version (9.3 to 9.4) on OS X. See upgraded version of this guide: http://olivierlacan.com/posts/migrating-homebrew-postgres-to-a-new-version/
View migrate_postgresql_database.md

This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.

First let's check something.

brew info postgresql

The top of what gets printed as a result is the most important:

@boopathi
boopathi / README.md
Last active Apr 11, 2019
Creating a Swift-ReactNative project
View README.md

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,
@roalcantara
roalcantara / Gemfile
Last active Feb 25, 2018
Rails 4 + Paperclip + Amazon S3
View Gemfile
#https://github.com/thoughtbot/paperclip
#http://rubydoc.info/gems/paperclip/Paperclip/Storage/S3
gem 'paperclip', github: 'thoughtbot/paperclip'
# S3 API
gem 'aws-sdk'
@korya
korya / Subfolder to git repo.md
Last active Jul 12, 2019
Convert subfolder into Git submodule
View Subfolder to git repo.md
You can’t perform that action at this time.