Skip to content

Instantly share code, notes, and snippets.

@mortbauer
mortbauer / Ruby_Rails_Naming_Conventions.md
Created February 16, 2024 16:43 — forked from elainenaomi/Ruby_Rails_Naming_Conventions.md
Ruby & Rails Naming Conventions

Alex's Rails Cheat Sheet

I think the most confusing thing that I have found about Ruby on Rails so far has been the transition from (trying to) write code myself to the use of the fabled "Rails Magic". So, to help my own understanding of a few core Ruby on Rails concepts, I have decided to write something on what I think is a CRITICAL topic... the idea of Convention over Configuration and why (in my mind) it is the most important thing that helps Rails become magic!

(This may be a topic that we cover in more detail in class but as I said, I'm writing this for my own understanding... I hope it helps someone else understand things too... Perhaps you can give me a hand when I'm crying next week!)

##Convention over configuration ###What does this "actually" mean...

@mortbauer
mortbauer / clip_magic.py
Created October 24, 2023 18:50 — forked from nova77/clip_magic.py
copy to clipboard ipython magic
"""
Add copy to clipboard from IPython!
To install, just copy it to your profile/startup directory, typically:
~/.ipython/profile_default/startup/
Example usage:
%clip hello world
# will store "hello world"
@mortbauer
mortbauer / zmq_auth.py
Created September 5, 2023 06:18 — forked from mivade/zmq_auth.py
ZeroMQ Curve authentication demo
"""Simple demonstration of using ZMQ's Curve authentication.
This demo is adapted from the examples given in the `PyZMQ repository`__. Key
differences include:
* Using ``setsockopt`` to set Curve parameters instead of setting attributes
directly (help out your IDE!)
* Integration with ``asyncio``
__ https://github.com/zeromq/pyzmq/tree/master/examples
@mortbauer
mortbauer / README.md
Created May 14, 2021 07:47
Ansible role to setup planka behind traefik and postgresql

Setup

  • postgresql on host
  • planka via docker
  • traefik via docker
  • deployment via ansible role

Difficulties

The main difficulty was to get the database

:!tidy -mi -html -wrap 0 %
import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.2
import QtMultimedia 5.0
import QtQuick.Layouts 1.11
Window {
id: mainWindow
title: "QApplication"
@mortbauer
mortbauer / QtMVC.ipynb
Created May 31, 2018 08:22
Qt MVC concept example in a Jupyter Notebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mortbauer
mortbauer / integrate_qt5_into_ipython.py
Created May 31, 2018 06:56
Integrate Qt5 into IPython kernel 6.1.0
%gui qt5
from PyQt5.QtWidgets import QMainWindow
win = QMainWindow()
win.show()
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
# Maintainer: Kazuo Teramoto <kaz.rag@gmail.com>
# Contributor: Mark Foxwell <fastfret79@archlinux.org.uk>
pkgname=alot-git
pkgver=0.3.5.20.g7ffe0bf
pkgrel=1
epoch=1
pkgdesc="A terminal interface for notmuch"
arch=('any')
url="https://github.com/pazz/alot"
license=('GPL')