In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
""" | |
Utilities for dumping STM32 peripheral registers with tab-completion | |
Based on a script by vampi-the-frog | |
Dependencies: | |
pip install -U cmsis-svd | |
Usage (inside gdb): | |
(gdb) source /path/to/svd-dump.py |
//: | |
import Foundation | |
import AWSS3 | |
//A sample struct to define the parameters to encode and send to the | |
//server to be executed along with your upload | |
struct FileUploadParameters{ | |
//label for the encoded name |
# modified from https://gist.github.com/schlamar/2311116#file-processify-py-L17 | |
# also see http://stackoverflow.com/questions/2046603/is-it-possible-to-run-function-in-a-subprocess-without-threading-or-writing-a-se | |
import inspect | |
import os | |
import sys | |
import traceback | |
from functools import wraps | |
from multiprocessing import Process, Queue |
import QuartzCore | |
extension CGFloat { | |
func map(from from: ClosedInterval<CGFloat>, to: ClosedInterval<CGFloat>) -> CGFloat { | |
let result = ((self - from.start) / (from.end - from.start)) * (to.end - to.start) + to.start | |
return result | |
} | |
} | |
extension Double { |
/* | |
NSData+Compression.swift | |
Created by Danilo Altheman on 17/06/15. | |
The MIT License (MIT) | |
Copyright © 2015 Quaddro - Danilo Altheman. 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 |
// #!Swift-1.1 | |
import Foundation | |
// MARK: - (1) classes | |
// Solution 1: | |
// - Use classes instead of struct | |
// Issue: Violate the concept of moving model to the value layer | |
// http://realm.io/news/andy-matuschak-controlling-complexity/ |
BOOL isDeviceJailbroken() | |
{ | |
#if !TARGET_IPHONE_SIMULATOR | |
//Apps and System check list | |
BOOL isDirectory; | |
if ([[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/%@%@%@%@%@%@%@", @"App", @"lic",@"ati", @"ons/", @"Cyd", @"ia.a", @"pp"]] | |
|| [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/%@%@%@%@%@%@%@", @"App", @"lic",@"ati", @"ons/", @"bla", @"ckra1n.a", @"pp"]] | |
|| [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"/%@%@%@%@%@%@%@", @"App", @"lic",@"ati", @"ons/", @"Fake", @"Carrier.a", @"pp"]] |
// put this in your AppDelegate | |
- (void)changeRootViewController:(UIViewController*)viewController { | |
if (!self.window.rootViewController) { | |
self.window.rootViewController = viewController; | |
return; | |
} | |
UIView *snapShot = [self.window snapshotViewAfterScreenUpdates:YES]; | |
[viewController.view addSubview:snapShot]; | |
self.window.rootViewController = viewController; |
#import "NSArray+Statistics.h" | |
@implementation NSArray (Statistics) | |
- (NSNumber *)sum { | |
NSNumber *sum = [self valueForKeyPath:@"@sum.self"]; | |
return sum; | |
} | |
- (NSNumber *)mean { |