Skip to content

Instantly share code, notes, and snippets.

@epicserve
epicserve / svn_to_git.rst
Created September 15, 2011 17:17
Convert SVN Repositories to Git Repositories

Convert SVN Repositories to Git Repositories

This guide on how to convert an SVN repository to a git repository was mostly taken from John Albin Wilkins post on Converting a Subversion repository to Git.

1. Retrieve a list of all Subversion committers

@xjones
xjones / TransitionController.h
Created November 26, 2011 03:48
TransitionController for animating iOS view controller transitions w/o a controller stack
//
// TransitionController.h
//
// Created by XJones on 11/25/11.
//
#import <UIKit/UIKit.h>
@interface TransitionController : UIViewController
@interface UIImage (fixOrientation)
- (UIImage *)fixOrientation;
@end
@quantumcheese
quantumcheese / Checkstyle pre-commit hook
Created March 2, 2012 20:34 — forked from davetron5000/Checkstyle pre-commit hook
Pre Commit Hook for running checkstyle on changed files
#!/usr/bin/perl
#
# Pre-commit hook for running checkstyle on changed Java sources
#
# To use this you need:
# 1. checkstyle's jar file somewhere
# 2. a checkstyle XML check file somewhere
# 3. To configure git:
# * git config --add checkstyle.jar <location of jar>
# * git config --add checkstyle.checkfile <location of checkfile>
@skram
skram / UIImage+Cache.h
Created June 6, 2012 06:16
UIImage extension, with custom cache control.
//
// UIImage+Cache.m
//
// Created by Mark on 6/6/12.
// Copyright (c) 2012 skram devs LLC. All rights reserved.
// http://skr.am
#import <UIKit/UIKit.h>
@shawnlinboy
shawnlinboy / SmartBarUtils.java
Last active April 18, 2025 13:34
一个扩展后的魅族SmartBar工具类,增加三种隐藏SmartBar的方法,过期一种方法。
package in.mobilelin.smartbar;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.app.ActionBar;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Build;
@vincentmac
vincentmac / sublime-text-osx-context-menu.md
Created September 25, 2013 18:03
Sublime Text OSX Context Menu

Add Sublime Text to OS X Context Menu

  • Open Automator
  • Create a new Service
  • Add a Run Shell Script action
  • Set input to Service receives selected files or folders in any application
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n $@
  • Set Pass input to as arguments
  • Save as Open in Sublime Text
@ejdyksen
ejdyksen / patch-edid.md
Last active March 24, 2026 02:51
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@nioe
nioe / HttpHeader.java
Last active January 30, 2024 20:40
Get remote IP from HttpServletRequest
public enum HttpHeader {
AUTHORIZATION("Authorization"),
AUTHENTICATION_TYPE_BASIC("Basic"),
X_AUTH_TOKEN("X-AUTH-TOKEN"),
WWW_Authenticate("WWW-Authenticate"),
X_FORWARDED_FOR("X-Forwarded-For"),
PROXY_CLIENT_IP("Proxy-Client-IP"),
WL_PROXY_CLIENT_IP("WL-Proxy-Client-IP"),
HTTP_CLIENT_IP("HTTP_CLIENT_IP"),
HTTP_X_FORWARDED_FOR("HTTP_X_FORWARDED_FOR");
@landys
landys / pre-receive-checkstyle-hook.py
Created November 30, 2015 13:38
The git pre-receive hook for java checkstyle check based on http://bluec0re.blogspot.com/2012/05/git-pre-receive-hook-with-checkstyle.html. Set checkstyle jar and xml with "git config checkstyle.checkfile google_checks.xml" and "git config checkstyle.jar checkstyle-6.12.1-all.jar".
#!/usr/bin/env python
import subprocess
import sys
import tempfile
import shutil
import os
import errno
# variables for checkstyle