Skip to content

Instantly share code, notes, and snippets.

View lamprosg's full-sized avatar

Lampros Giampouras lamprosg

  • Athens, Greece
View GitHub Profile
@lamprosg
lamprosg / 0.Swift Evolution
Last active September 9, 2022 12:12
(iOS) Swift tutorial
https://github.com/apple/swift-evolution
@lamprosg
lamprosg / captureViewAsUIImage.m
Created October 1, 2014 08:19
(iOS) Capture a UIView as a UIImage
// capture the contents of the view in the rect specified
- (UIImage*)captureView:(UIView*)view rect:(CGRect)rect {
if (rect.size.width == 0 || rect.size.height == 0)
rect = view.bounds;
UIGraphicsBeginImageContext(view.bounds.size);
CGContextClipToRect(UIGraphicsGetCurrentContext(), rect);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *anImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
@lamprosg
lamprosg / Convert.m
Created August 22, 2014 14:14
(iOS) Object to NSDictionary conversion
#import <objc/runtime.h>
ProductDetails *details = [[ProductDetails alloc] init];
details.name = @"Soap1";
details.color = @"Red";
details.quantity = 4;
NSDictionary *dict = [NSDictionary dictionaryWithPropertiesOfObject: details];
NSLog(@"%@", dict);
//Add this utility method in your class.
@lamprosg
lamprosg / README
Created May 14, 2014 14:16
(iOS) Tutorial: Provision Your App to Run on a Device
http://www.brianjcoleman.com/tutorial-provision-your-app-to-run-on-a-device/
@lamprosg
lamprosg / IAP
Created May 6, 2014 10:05
(Android) In-app purchasing
Official:
http://developer.android.com/google/play/billing/billing_integrate.html
Easy to use library:
https://github.com/anjlab/android-inapp-billing-v3
@lamprosg
lamprosg / (Android) Awesome libraries
Created April 30, 2014 09:04
(Android) Awesome libraries
http://a.code4app.com/category?sort=1
@lamprosg
lamprosg / pulltorefresh
Created April 11, 2014 12:46
(Android) Pull to refresh
https://github.com/chrisbanes/Android-PullToRefresh
@lamprosg
lamprosg / gist:10366568
Last active August 29, 2015 13:58
(iOS) Awesome libraries
Collection of awesome libraries
http://code4app.net/
Javascript native code
http://impactjs.com/ejecta
iOS/OSX bridge for sending messages between Obj-C and JavaScript
https://github.com/marcuswestin/WebViewJavascriptBridge
@lamprosg
lamprosg / OnSwipeTouchListener.java
Created April 10, 2014 09:57
(Android) Swipe gesture
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
public class OnSwipeTouchListener implements OnTouchListener {
private final GestureDetector gestureDetector;
@lamprosg
lamprosg / speech_recognition
Last active August 29, 2015 13:58
(iOS) Speech
# iOS7 Day-by-Day: Day 4
## Speech Synthesis with AVSpeechSynthesizer
### Introduction
Include AVFoundation framework to project
#import <AVFoundation/AVFoundation.h>
iOS has had speech synthesis as part of siri since iOS 5, but it was never