Skip to content

Instantly share code, notes, and snippets.

@jad
jad / iPhone: Drawing a Drop Shadow
Created May 2, 2009 17:48
Simple example of drawing a drop shadow with Core Graphics.
- (void)drawRect:(CGRect)rect
{
[super drawRect:rect];
rect = [self bounds];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
// use the same background color as the view, but with an alpha of 1.0
@kylefox
kylefox / color.m
Created January 27, 2012 17:45
Generate a random color (UIColor) in Objective-C
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
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 to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@jazzychad
jazzychad / SPVMainViewController.m
Created December 8, 2013 22:04
example of transferring velocity of UIPanGestureRecoginizer to a UIView spring animation.
#import "SPVMainViewController.h"
@implementation SPVMainViewController
{
UIView *_weightView;
UIPanGestureRecognizer *_recog;
}
- (void)viewDidLoad
{

Swift Note

Swift Note #1

@SeriouslyAwesome
SeriouslyAwesome / Gemfile
Last active April 1, 2024 20:50 — forked from tylerhunt/Gemfile
ActiveAdmin association autocomplete without complicated plugins.
gem 'active_model_serializers'
gem 'activeadmin'
gem 'jquery-ui-rails'