Skip to content

Instantly share code, notes, and snippets.

View raphaelhanneken's full-sized avatar

Raphael Hanneken raphaelhanneken

View GitHub Profile
@raphaelhanneken
raphaelhanneken / muffin.theme.bash
Last active December 1, 2017 16:07
A minimal bash theme
#!/usr/bin/env bash
txtblk='\[\e[0;30m\]' # Black
txtred='\[\e[0;31m\]' # Red
txtgrn='\[\e[0;32m\]' # Green
txtylw='\[\e[0;33m\]' # Yellow
txtblu='\[\e[0;34m\]' # Blue
txtpur='\[\e[0;35m\]' # Purple
txtcyn='\[\e[0;36m\]' # Cyan
txtwht='\[\e[0;37m\]' # White
@raphaelhanneken
raphaelhanneken / ruby_do_end.sublime-snippet
Created September 22, 2015 09:42
Sublime Text snippet for ruby's do...end block.
<snippet>
<content><![CDATA[do
$1
end
]]></content>
<tabTrigger>do</tabTrigger>
<scope>source.ruby</scope>
<description>do..end</description>
</snippet>
@raphaelhanneken
raphaelhanneken / navbar_link_helper.rb
Created September 8, 2015 21:32
Creates a link wrapped in a list element, including class="active" for the currently active element.
@raphaelhanneken
raphaelhanneken / NSImageExtensions.swift
Last active August 24, 2023 01:04
NSImage extensions for easy resizing, cropping and saving png images.
//
// NSImageExtensions.swift
//
import Cocoa
extension NSImage {
/// The height of the image.
var height: CGFloat {
@raphaelhanneken
raphaelhanneken / DragAndDropImageView.swift
Last active February 15, 2023 13:29
NSImageView with drag and drop capabilities written in Swift.
//
// DragAndDropImageView.swift
// Iconizer
// https://github.com/raphaelhanneken/iconizer
//
import Cocoa
class DragDropImageView: NSImageView, NSDraggingSource {
/// Holds the last mouse down event, to track the drag distance.