Skip to content

Instantly share code, notes, and snippets.

@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:

@wingleung
wingleung / prepare-commit-msg.sh
Last active October 30, 2023 08:50
Automatically prepend JIRA issue key to commit message
#!/bin/sh
#
# Automatically adds Jira key to commit message
#
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
@spaghetticode
spaghetticode / 06.updates.md
Last active October 18, 2018 08:38
06.updates

This second paragraph in total looks very nice. It even shows how to use the "suggest" feature standalone. However, whether or not it may be embedded and executed in the actual search, we do not know. (Note: we're still in operation "2d) search")

You can combine the suggester with a query. You can use the same term or even use different words for suggestion and query. Let's see an example:

GET /docs/doc/_search
{
  "query": {
    "match": {"title": "liitle neemo"}
  },
@spaghetticode
spaghetticode / 04.fuzzy.md
Last active October 18, 2018 08:39
Queries continued - fuzzy search

Fuzzy query

Basic fuzzy queries:

GET /docs/doc/_search
{
  "query": {
    "fuzzy": {
      "body": "robot"
@spaghetticode
spaghetticode / 03.queries.md
Last active October 18, 2018 08:40
More queries

-OR (better), if feasible:

whole phrases instead of words for context-awareness

Let's see some possible solutions. This one will look for the three words in the body, but requires that only 2 of them are present:

GET /docs/doc/_search
{
  "query": {
    "match": {
@almostintuitive
almostintuitive / SVGView.h
Created June 8, 2014 15:51
SVGView for iOS (using UIWebView)
//
// SVGView.h
// Just call the loadSVG method with the SVG's NSData to display it with transparent background & scrollbars.
//
// github.com/itchingpixels.
//
#import <UIKit/UIKit.h>
@interface SVGView : UIWebView <UIWebViewDelegate>
@bartek
bartek / gist:2425130
Created April 20, 2012 01:08
Cloudmade SDK setup with Xcode 4.x

CloudMade SDK Setup with Xcode 4.x

This is actually a lot simpler in Xcode 4, but you just need to know where to get around.

First, get the CloudMade libraries as per the original instructions and check them out into your project folder.

svn co http://developers.cloudmade.com/svn/iphone-api/iphone-api/trunk/inc
svn co http://developers.cloudmade.com/svn/iphone-api/iphone-api/trunk/libs
@marcel
marcel / gist:2100703
Created March 19, 2012 07:24
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@pomartel
pomartel / facebook.rb
Created March 7, 2011 18:34
Rack application that converts the request from a POST to a GET when a signed_request parameter is present in the request. This lets you develop restful Facebook canvas applications.
# You can put this file in your lib directory.
# Don't forget to add 'use Rack::Facebook' in config.ru.
module Rack
class Facebook
def initialize(app)
@app = app
end
def call(env)
@jamis
jamis / Basic Baechu Kimchi
Last active May 23, 2020 21:18
Basic Baechu Kimchi
BASIC BAECHU KIMCHI
--------------------------------------------------------------------------
Baechu (Napa cabbage) kimchi is one of the staple foods in Korea. Spicy
and tangy, it is typically served as a side dish, with rice, but is also
found in various Korean soups and stews.
This basic version has just the fundamentals; once you're comfortable
with this version, you might try adding shredded carrots, Daikon radish,
pickled baby shrimp, or any number of other things. Search around online