Skip to content

Instantly share code, notes, and snippets.

View vdeep's full-sized avatar
🎯
Focusing

Vishal Kanojia vdeep

🎯
Focusing
  • Punjab, India
View GitHub Profile
@vdeep
vdeep / Sublime Fetch
Last active July 22, 2017 13:37
Fetch system configuration for Sublime
{
"files":
{
"angularjs": "http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js",
"backbonejs": "http://backbonejs.org/backbone-min.js",
"handlebarsjs": "https://raw.github.com/wycats/handlebars.js/master/lib/handlebars/base.js",
"jquery": "http://code.jquery.com/jquery.min.js",
"json2": "https://raw.github.com/douglascrockford/JSON-js/master/json2.js",
"mustachejs": "https://raw.github.com/janl/mustache.js/master/mustache.js",
"normalizecss": "https://raw.github.com/necolas/normalize.css/master/normalize.css",
@vdeep
vdeep / gist:aa49cc51557cab7ba5bc
Created December 22, 2015 10:56
Change permissions of file according to git status
chmod 755 `git status --porcelain | perl -nle '/M (.*)/ and print $1'`
{
"aps":
{
"alert": {
"title": "Notification title",
"body": "Notification text"
},
"sound": "default",
"badge": 1
}
- (void)addSwipeViewWith:(NSIndexPath*)currentIndexPath {
NSLog(@"currentIndexPath %@ ",currentIndexPath);
// _selectedImageView = ((KUMediaCell*)gesture.view).imageView;
// NSMutableArray *photos = [[NSMutableArray alloc] init];
// MWPhoto *photo;
//
// NSUInteger lastIndex = [[[self.collectionView.fetchedResultController sections] objectAtIndex:0] numberOfObjects];
@vdeep
vdeep / gist:fc2c80d747945a6822f91810244905de
Created December 8, 2016 07:56 — forked from kublaios/gist:f01cdf4369c86ddd6d71
Making a PEM File for iOS Push Notifications (From Ray Wenderlich's tutorial)
# Convert the .cer file into a .pem file:
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem
# Convert the private key’s .p12 file into a .pem file:
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem
# Finally, combine the certificate and key into a single .pem file
$ cat PushChatCert.pem PushChatKey.pem > ck.pem
# At this point it’s a good idea to test whether the certificate works.
@vdeep
vdeep / 0_reuse_code.js
Created September 9, 2017 07:25
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
@vdeep
vdeep / ReachabilityManager.swift
Last active January 2, 2018 07:49
ReachabilityManager - Using https://github.com/ashleymills/Reachability.swift, updated for Swift 4.2
import Foundation
import Reachability
class ReachabilityManager: NSObject {
static let shared = ReachabilityManager()
var isNetworkAvailable: Bool {
return reachabilityStatus != .none
}
@vdeep
vdeep / .eslintrc
Created January 16, 2018 05:12
React-Native JSLint
{
"parser": "babel-eslint",
"env": {
"browser": true
},
"plugins": [
"react"
],
"extends": [
"eslint:recommended",
@vdeep
vdeep / Dockerfile
Created February 18, 2018 17:22 — forked from jcavat/Dockerfile
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
@vdeep
vdeep / UIViewController.swift
Created March 3, 2018 05:32
UIViewController extension to instantiate view controller from storyboard or xib file of the same name
import UIKit
extension UIViewController {
static func initWithStoryboard(_ storyboard: UIStoryboard? = nil,
_ identifier: String? = nil) -> UIViewController? {
var _storyboard = storyboard
if storyboard == nil {