Skip to content

Instantly share code, notes, and snippets.

View harry1064's full-sized avatar

Harpreet singh harry1064

View GitHub Profile
@harry1064
harry1064 / ELK with Nginx.md
Created March 28, 2018 05:32 — forked from Dev-Dipesh/ELK with Nginx.md
Setting up Elasticsearch, Logstash and Kibana with Nginx.

ELK (Elasticsearch Logstash Kibana)

Though we're focused more on server setup procedure in this document, I will still give a very brief explanation in laymen terms for ELK. To those who are starting new in this stack, must have already heard of MVC (Model View Controller), so take it like this:

  • Model => Elasticsearch (for Storage, Indexing & Search)
  • View => Kibana (for DataViz & G-Man, yeah the one in half life 😏)
  • Controller => Logstash (For Logs & Filtering)

@harry1064
harry1064 / instructions.md
Last active October 27, 2017 06:16
Remote Node.js Debug using webstorm

Debugging node running on a remote server

The following shows you how to start node with the debug flag and use an SSH tunnel to access the right port.

Things you need:

  • ssh access to the server
  • ability to restart node app with --debug flag.

Debugging using Webstorm

@harry1064
harry1064 / storage.swift
Created August 7, 2017 07:02 — forked from avdyushin/storage.swift
CoreData stack for iOS 9 and iOS 10 using Swift 3
//
// Storage.swift
//
// Created by Grigory Avdyushin on 30.06.16.
// Copyright © 2016 Grigory Avdyushin. All rights reserved.
//
import UIKit
import CoreData
<html>
<head>
<META HTTP-EQUIV="EXPIRES" CONTENT="-1" />
<script type="text/javascript">
function showFrontLayer() {
document.getElementById('bg_mask').style.visibility='visible';
document.getElementById('frontlayer').style.visibility='visible';
}
function hideFrontLayer() {
up vote
55
down vote
Here is the cleanest way to achieve this in iOS 7.0.
scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
Or
scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;
Objective-C
iOS7 > version
You can use NSData's base64EncodedStringWithOptions
Encoding :
- (NSString *)encodeToBase64String:(UIImage *)image {
return [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
}
http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html