Skip to content

Instantly share code, notes, and snippets.

@nbasham
nbasham / UIColor.swift
Last active December 18, 2023 21:04
Swift 4: Convert CSS color names and RGB hex values to UIColor. UIColor from hex 3, 4, 6, and 8 characters in length with or without # prefix. UIColor to hex. UIColor extension that creates immutable UIColor instances from hexadecimal and CSS color name strings (e.g. ff0, #f00, ff0000, ff0000ff, Pink, aZure, CLEAR, nil). Conversely, you can obta…
//
// UIColor.swift
// previously Color+HexAndCSSColorNames.swift
//
// Created by Norman Basham on 12/8/15.
// Copyright ©2018 Black Labs. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@letmein
letmein / .bash_prompt
Created April 19, 2015 19:03
bash prompt for rbenv & git
#!/bin/bash
# Add this to the end of .bashrc
# prompt with ruby version
# rbenv version | sed -e 's/ .*//'
__rbenv_ps1 ()
{
rbenv_ruby_version=`rbenv version | sed -e 's/ .*//'`
printf $rbenv_ruby_version
}
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@besi
besi / Environment.h
Created May 24, 2012 14:56
Environment
//
// Environment.h
//
#import <Foundation/Foundation.h>
// Convenience Macros
#define ENVIRONMENT_PROPERTY(key) @property (readonly) NSString *key;
#define ENVIRONMENT_PROPERTY_BOOL(key) @property (readonly) BOOL key;
@besi
besi / PullGitRepos.rb
Created March 17, 2011 08:13
Goes through a list of paths and performs a git pull
#!/usr/bin/env ruby
# List of git-enabled projects
repos = [
"~/Projects/ProjectA",
"~/Projects/ProjectB",
]
line = "\n" + "*" * 50
thinLine = "\n" + '-' * 50