Skip to content

Instantly share code, notes, and snippets.

View karmanov's full-sized avatar

Dmytro Karmanov karmanov

View GitHub Profile
@karmanov
karmanov / gist:7008142
Created October 16, 2013 13:55
Monitor a Folder using Java
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardWatchEventKinds;
import java.nio.file.WatchEvent;
import java.nio.file.WatchKey;
import java.nio.file.WatchService;
public class App04 {

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@karmanov
karmanov / gist:8709801
Created January 30, 2014 14:39
Windows shutdown functions
shutdown -r — restarts
shutdown -s — shutsdown
shutdown -l — logoff
shutdown -t xx — where xx is number of seconds to wait till shutdown/restart/logoff
shutdown -i — gives you a dialog box to fill in what function you want to use
shutdown -a — aborts the previous shutdown command....very handy!
Additional options:
-f — force the selected action
@karmanov
karmanov / gist:8903291
Last active August 29, 2015 13:56
HTTP Status Codes
Status Codes are used by the client application to know the status of a request processing in the server. The status code has 3 digit numbers, where the first digit defines the class of the response.
The Status code are of 5 categories namely:
1XX – Informational
2XX – Success
3XX – Redirection
4XX – Client Error
5XX – Server Error
---------------------------------------------------------
Informational Codes
---------------------------------------------------------
@karmanov
karmanov / gist:11286640
Last active August 29, 2015 14:00
How to enable MySQL query monitoring

How to enable MySQL query monitoring

Do you need to monitor any SQL statements passing through your MySQL server? You would need to turn on the server logging. Edit your my.cnf file and add these:

log-output=FILE
general-log=1
general_log_file=mysql-general.log
@karmanov
karmanov / gist:499e0dfdf8e5ce119ad4
Created July 20, 2014 08:07
spring.jpa.hibernate.ddl-auto values
validate: validate the schema, makes no changes to the database.
update: update the schema.
create: creates the schema, destroying previous data.
create-drop: drop the schema at the end of the session.
@karmanov
karmanov / gist:0a962ac326e5fc20c168
Created July 20, 2014 16:45
spring boot properties
# ===================================================================
# COMMON SPRING BOOT PROPERTIES
#
# This sample file is provided as a guideline. Do NOT copy it in its
# entirety to your own application. ^^^
# ===================================================================
# ----------------------------------------
# CORE PROPERTIES
# ----------------------------------------
@karmanov
karmanov / API.md
Last active August 29, 2015 14:06 — forked from iros/API.md

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@karmanov
karmanov / GetParamValue.js
Last active August 29, 2015 14:11
Get parameter value from url
function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++) {
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam) {
return sParameterName[1];
}
}
}
@karmanov
karmanov / What Program Is Using Port 8080
Created January 6, 2015 09:15
What Program Is Using Port 8080
$ sudo lsof -i :8080 | grep LISTEN
$ sudo ps -ef | grep 12895