Skip to content

Instantly share code, notes, and snippets.

Chris Dzombak cdzombak

Block or report user

Report or block cdzombak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cdzombak
cdzombak / README.md
Created Sep 28, 2010
recursive ksort function for PHP
View README.md
@cdzombak
cdzombak / README.md
Created Sep 28, 2010
Redirect visitors to a domain without affecting OpenID
View README.md

You may want to redirect (HTTP 301) visitors from a site which acts as an OpenID endpoint. Of course, you don't want to break everything which relies on that OpenID endpoint.

There is no definitive way to tell whether the client is an OpenID client or a human visitor, but you can look for certain criteria which are usually signs that the client isn't a standard Web browser.

This set of .htaccess rules should accomplish this in most cases. I've put this together based on a few examples online plus my own testing with a few OpenID clients.

@cdzombak
cdzombak / README.md
Created May 9, 2011
check whether an element is currently visible (JS)
View README.md

This is a small Javascript function which tells you whether an HTML element is currently visible - that is, whether or not it's been scrolled out of view on the page.

This function requires jQuery.

View StopOn500Activity.java
package com.cguild.stopon500;
import java.util.concurrent.atomic.AtomicInteger;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
View gist:1452149
* http://eagain.net/articles/git-for-computer-scientists/
* http://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide
* http://gitref.org/
* http://gitready.com/
* http://progit.org/book/
* http://book.git-scm.com/
* http://schacon.github.com/git/user-manual.html
* http://www-cs-students.stanford.edu/~blynn/gitmagic/
And a few tutorial/cheat sheet style references:
@cdzombak
cdzombak / hideyokids.txt
Created Mar 22, 2012
Cougar on North Campus
View hideyokids.txt
Delivered-To: chris@chrisdzombak.net
Received: by 10.223.116.142 with SMTP id m14csp86053faq;
Thu, 22 Mar 2012 10:56:13 -0700 (PDT)
Received: by 10.50.192.202 with SMTP id hi10mr2747102igc.3.1332438972973;
Thu, 22 Mar 2012 10:56:12 -0700 (PDT)
Return-Path: <targetemail@umich.edu>
Received: from gremlins.mr.itd.umich.edu (gremlins.mr.itd.umich.edu. [141.211.14.24])
by mx.google.com with ESMTP id cf2si2712340igb.24.2012.03.22.10.56.12;
Thu, 22 Mar 2012 10:56:12 -0700 (PDT)
@cdzombak
cdzombak / if.m
Created Jun 19, 2012
switch vs if with pointers (if C allowed switch on ptrs)
View if.m
// `item` is a UINavigationItem*
if (item == self.welcomeNavItem) {
return NO;
}
else if (item == self.emailNavItem) {
[self transitionToWelcomeScreen:YES];
return YES;
}
else if (item == self.passwordNavItem) {
@cdzombak
cdzombak / gist:3860927
Last active Oct 11, 2015 — forked from andrewsardone/gist:3859525
enum types in C/Objective-C
View gist:3860927
// unpredictable backing type for this enum
typedef enum {
CDZTypePhone,
CDZTypeEmail
} CDZType;
// vs.
enum {
CDZTypePhone,
@cdzombak
cdzombak / CDZTableViewSplitDelegate.h
Created Jan 4, 2013
Separate concerns. `UIScrollViewDelegate` deals with a container, while `UITableViewDelegate` deals with content. It's often useful to have two different objects manage these concerns, but Cocoa Touch makes it difficult since `UITableViewDelegate` conforms to `UIScrollViewDelegate` and `UITableView` has only one delegate property. `CDZTableViewS…
View CDZTableViewSplitDelegate.h
#import <Foundation/Foundation.h>
@interface CDZTableViewSplitDelegate : NSObject <UIScrollViewDelegate, UITableViewDelegate>
@property (nonatomic, weak) id<UITableViewDelegate> tvDelegate;
@property (nonatomic, weak) id<UIScrollViewDelegate> svDelegate;
- (id)initWithScrollViewDelegate:(id<UIScrollViewDelegate>)scrollViewDelegate tableViewDelegate:(id<UITableViewDelegate>)tableViewDelegate;
@end
@cdzombak
cdzombak / gist:5058153
Created Feb 28, 2013
name.com shadiness
View gist:5058153
> dig NS chrisdzombak.net
; <<>> DiG 9.8.3-P1 <<>> NS chrisdzombak.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29020
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;chrisdzombak.net. IN NS
You can’t perform that action at this time.