Skip to content

Instantly share code, notes, and snippets.

View DmitrySeredinov's full-sized avatar

Dmitry Seredinov DmitrySeredinov

View GitHub Profile
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification
apply plugin: 'android'
targetCompatibility = 1.6
sourceCompatibility = 1.6
android {
target = 'android-14'
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
  • Buy a mac mini
  • Install 10.8
  • Create a user account for Jenkins
  • Install xcode
  • Turn on screen sharing
  • Turn off energy save sleeping
  • Login as your jenkins user
  • Use ssh-keygen to create a key for github
  • Create a github account for your build machine
  • Add the key to your build machine github account
#!/bin/sh
# btsync service
# Replace with linux users you want to run BTSync clients for
BTSYNC_USERS="mendel"
DAEMON=/usr/bin/btsync
start() {
for btsuser in $BTSYNC_USERS; do
HOMEDIR=`getent passwd $btsuser | cut -d: -f6`
config=$HOMEDIR/.sync/config.json
CTFontManagerRegisterFontsForURLs((__bridge CFArrayRef)((^{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *resourceURL = [[NSBundle mainBundle] resourceURL];
NSArray *resourceURLs = [fileManager contentsOfDirectoryAtURL:resourceURL includingPropertiesForKeys:nil options:0 error:nil];
return [resourceURLs filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSURL *url, NSDictionary *bindings) {
CFStringRef pathExtension = (__bridge CFStringRef)[url pathExtension];
NSArray *allIdentifiers = (__bridge_transfer NSArray *)UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, pathExtension, CFSTR("public.font"));
if (![allIdentifiers count]) {
return NO;
}
#import <UIKit/UIKit.h>
@interface MySegueWithCustomAnimation : UIStoryboardSegue
@end

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

Copyright (c) 2011-2012 James Tang (mystcolor@gmail.com)
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 permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH TH

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add git@github.com:AFNetworking/AFNetworking.git Vendor/AFNetworking

or something to that effect.