Skip to content

Instantly share code, notes, and snippets.

View hemant3370's full-sized avatar
😃
Focusing

Hemant Singh hemant3370

😃
Focusing
View GitHub Profile
@hemant3370
hemant3370 / 0_reuse_code.js
Created October 22, 2015 10:52
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
http://www.devfright.com/uikitdynamics-sliding-menu/
@hemant3370
hemant3370 / popover.m
Created November 30, 2015 10:16
popover initiation
-(void)countryPop{
UIViewController *countryContent = [[UIViewController alloc]init];
UIView *popDataPickerView = [[UIView alloc]init];
popDataPickerView.backgroundColor = [UIColor whiteColor];
UIPickerView *countryPicker = [[UIPickerView alloc]init];
self.countryList = [[UIPopoverController alloc]initWithContentViewController:countryContent];
self.countryList.delegate = self;
countryPicker.delegate=self;
countryPicker.dataSource = self;
@hemant3370
hemant3370 / popover.m
Created November 30, 2015 10:19
viewdidload with picker delegates
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[[self navigationController] setNavigationBarHidden:NO animated:NO];
pickerArray = [[NSArray alloc]init];
txtContent = [[NSString alloc]init];
__autoreleasing NSError* error = nil;
NSStringEncoding* enc = nil;
@hemant3370
hemant3370 / GIF-Screencast-OSX.md
Created April 28, 2016 05:20 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

//
// RBResizer.swift
// Locker
//
// Created by Hampton Catlin on 6/20/14.
// Copyright (c) 2014 rarebit. All rights reserved.
// Updated by Justin Winter on 11/29/15.
//
extension UIImage {
// Showing the menu action sheet
var documentMediaTypes: [String] = []
documentMediaTypes.append(String(kUTTypePDF))
documentMediaTypes.append(String(kUTTypePNG))
documentMediaTypes.append(String(kUTTypeImage))
documentMediaTypes.append(String(kUTTypeVideo))
documentMediaTypes.append(String(kUTTypeMovie))
documentMediaTypes.append(String(kUTTypeItem))
//
// HSCache.swift
// Cache
//
// Created by Hemant Singh on 10/11/16.
// Copyright © 2016 Hemant Singh. All rights reserved.
//
import UIKit
@hemant3370
hemant3370 / collectioncellalert.swift
Created March 4, 2017 12:31
collectionview cell in popup
let alertController = UIAlertController(title:"" , message: "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", preferredStyle: UIAlertControllerStyle.actionSheet)
let view = (collectionView.cellForItem(at: indexPath)?.contentView)!.copyView()
alertController.view.addSubview(view)
let cancelAction = UIAlertAction(title: "Done", style: .cancel, handler: {(alert: UIAlertAction!) in
collectionView.reloadData()
})
alertController.addAction(cancelAction)
alertController.popoverPresentationController?.sourceView = collectionView.cellForItem(at: indexPath)
let circlePath2 = UIBezierPath(arcCenter: CGPoint(x: self.swapBtn.frame.midX, y: self.swapBtn.frame.midY), radius: -self.frame.width/3, startAngle: CGFloat(M_PI * 2.0), endAngle: CGFloat(M_PI) , clockwise: false)
let animation2 = CAKeyframeAnimation(keyPath: "position");
animation2.duration = 0.7
animation2.repeatCount = MAXFLOAT
animation2.path = circlePath2.cgPath
animation2.repeatCount = 0
animation2.fillMode = kCAFillModeForwards
animation2.isRemovedOnCompletion = false
let circlePath = UIBezierPath(arcCenter: CGPoint(x: self.swapBtn.frame.midX, y: self.swapBtn.frame.midY), radius: -self.frame.width/3, startAngle: CGFloat(M_PI) , endAngle: CGFloat(M_PI * 2.0) , clockwise: true)
let animation = CAKeyframeAnimation(keyPath: "position");