Skip to content

Instantly share code, notes, and snippets.

View xandrucea's full-sized avatar

Alex Cio xandrucea

View GitHub Profile
/*
* System Versioning Preprocessor Macros
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
Create ActionSheet for iOS 7 and iOS 8
--------------------------------------
// if( [[UIDevice currentDevice] systemVersion].doubleValue < 8.0 ){
UIActionSheet *actionSheet = [UIActionSheet new];
[actionSheet setTitle:prodAdFree.localizedTitle];
[actionSheet setDelegate:self];
[actionSheet setCancelButtonIndex:2];
[actionSheet addButtonWithTitle:NSLocalizedString(@"Produkt kaufen", @"")];
[actionSheet addButtonWithTitle:NSLocalizedString(@"Produkt wiederherstellen", @"")];
[actionSheet addButtonWithTitle:NSLocalizedString(@"Abbrechen", @"")];
@xandrucea
xandrucea / pi
Last active August 29, 2015 14:00
TO SOLVE
--------
:80 already in use. change from tomcat to apache
pi itself
---------
cat [filename]
print file
cat [filename] | less
make icon corner transparent
----------------------------
- select image
- Menü Auswahl -> Abgerundetes Rechteck... --> ~38 / 39
- invert selection CMD + I
- press delete
- export image CMD + E
Bilder beschneiden
@xandrucea
xandrucea / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@xandrucea
xandrucea / css_resources.md
Last active August 29, 2015 14:08 — forked from jookyboi/css_resources.md
CSS libraries and guides

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

function throttle( fn, time ) {
var t = 0;
return function() {
var args = arguments, ctx = this;
clearTimeout(t);
t = setTimeout( function() {
fn.apply( ctx, args );
}, time );
};