Skip to content

Instantly share code, notes, and snippets.

View Doerge's full-sized avatar

Aske Doerge Doerge

  • Berlin
View GitHub Profile
@Doerge
Doerge / copy_ecto_hierachy_example.ex
Created June 10, 2020 17:57
Example of copying a hierachy of an Ecto schema.
defmodule MyApp.Item do
use Ecto.Schema
import Ecto.Changeset
alias MyApp.Item
schema "items" do
field :name, :string
belongs_to :parent, Item
has_many :children, Item, foreign_key: :parent_id

Keybase proof

I hereby claim:

  • I am doerge on github.
  • I am doerge (https://keybase.io/doerge) on keybase.
  • I have a public key ASBOeCW5ooDzu9OGWkZKF-iYQs8pIu248Slsd9a9b9gRewo

To claim this, I am signing this object:

@Doerge
Doerge / iterm_setup.md
Last active January 23, 2023 14:35
Terminal styling for the eyes and the fingers. Includes many productive plugins for oh-my-zsh
var colors = ["Telemagenta","Snow","Sunglow","Sienna","Sepia","Ochre","Olive","Cornsilk","Iris","Ruddy","Glaucous","Limerick","Viridian","Waterspout","Alabaster","Pink","Livid","Flame","Licorice","Eggplant","Lumber","Milk","Rosewood","Feldgrau","Begonia","Imperial","Sangria","Tomato","Mauvelous","Russet","Mauve","Regalia","Cherry","Volt","Blue","Coconut","Irresistible","Deer","Gunmetal","Tan","Cordovan","Liver","Mandarin","Mint","Mantis","Amber","Coffee","Wheat","Peach","Glitter","Patriarch","Rackley","Rose","Wisteria","Isabelline","Amazon","Ebony","Firebrick","Amaranth","Ecru","Cinereous","Kobi","Jasper","Moccasin","Tumbleweed","Honeydew","Salmon","Beige","Byzantium","Straw","Quartz","Celeste","Vermilion","Grape","Sage","Citron","Turquoise","Taupe","Liberty","Rhythm","Shampoo","Peridot","Rajah","Sunset","Ginger","Bistre","Yellow","Azure","Eggshell","Brass","Burgundy","Red","Topaz","Kiwi","Avocado","Fulvous","Buff","Onyx","Rufous","Marigold","Popstar","Prune","Pearl","Smitten","Icterine","Gray","Toolbox","Gru
@Doerge
Doerge / test_settings.json
Last active March 4, 2016 19:04
flask-zappa test settings
{
"development": {
"s3_bucket": "my-flask-test-bucket",
"settings_file": "development_settings.py",
"project_name": "MyFlaskTestProject",
"exclude": ["*.git*", "./static/*", "*.DS_Store", "tests/*", "*.zip"]
},
"staging": {
"s3_bucket": "staging-bucket",
"settings_file": "staging_settings.py",
@Doerge
Doerge / development_settings.py
Last active March 4, 2016 19:05
flask-zappa test settings
APP_MODULE="test_app"
APP_OBJECT="app"
@Doerge
Doerge / test_app.py
Last active July 5, 2017 18:03
Basic app for testing flask-zappa functionality.
# -*- coding: utf-8 -*-
from flask import Flask, request, redirect, url_for, session, abort, current_app, json
app = Flask(__name__)
# This is the very unsecret key from the Flask-docs
app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'
@app.route('/')
@Doerge
Doerge / FirehoseConnection.py
Created October 23, 2015 16:13
Kinesis Firehose put_record() for boto
import base64
import boto
from boto.connection import AWSQueryConnection
from boto.regioninfo import RegionInfo
from boto.exception import JSONResponseError
from boto.kinesis import exceptions
from boto.compat import json
from boto.compat import six

Why So Serious?

On Mac OS X (and possibly other systems) you can brighten up your terminal prompt with emojii's like this: ![Image of Yaktocat] (https://gist.githubusercontent.com/Doerge/02cb0e4d572f9b0f0cd8/raw/showcase.png)

To do this, you should modify the special shell variable PS1 in ~/.profile (or in another config file of your choosing). Put the following snippets on unique lines in that file.

You can either put a single emojii in you prompt, which will always show up when you open a new terminal:

export PS1="\\h:\\w🍔:"