Skip to content

Instantly share code, notes, and snippets.

@bozhink
bozhink / geo-location.html
Created July 6, 2017 11:50
Geo Location in HTML5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script>
@bozhink
bozhink / fts-t.sql
Created July 5, 2017 13:36
FullTest search in tSQL
-- https://www.simple-talk.com/sql/learn-sql-server/understanding-full-text-indexing-in-sql-server/
IF OBJECT_ID (N'ProductDocs', N'U') IS NOT NULL  
DROP TABLE ProductDocs  
GO
CREATE TABLE ProductDocs (  
  DocID INT NOT NULL IDENTITY,  
  DocTitle NVARCHAR(50) NOT NULL,  
  DocFilename NVARCHAR(400) NOT NULL,  
  FileExtension NVARCHAR(8) NOT NULL,  
  DocSummary NVARCHAR(MAX) NULL,  
@bozhink
bozhink / excel-reader.cs
Last active June 6, 2017 10:11
Read data from MS Excel
/// <summary>
/// See https://coderwall.com/p/app3ya/read-excel-file-in-c
/// </summary>
namespace App
{
using System;
using System.Runtime.InteropServices;
using Excel = Microsoft.Office.Interop.Excel; //microsoft Excel 14 object in references-> COM tab
public class Program
@bozhink
bozhink / Flexbox menu sample
Created May 25, 2017 06:01
Flexbox menu sample at CodePen
http://codepen.io/oknoblich/pen/klnjw
@bozhink
bozhink / gist:dd466b4511937b1d0d027ed76fec8f89
Created May 17, 2017 12:52
Install and run Windows service
See https://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx
Service lifecycle:
Install service: C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe TasksService.exe
Start service: NET START TasksRunnerService
Stop service: NET STOP TasksRunnerService
Uninstall service: C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe /u TasksService.exe
@bozhink
bozhink / ExecuteProcess.cs
Last active February 24, 2023 04:30
Execute process in C# without console
using System;
using System.Diagnostics;
using System.Text;
public class Program
{
public static void Main(string[] args)
{
if (args.Length < 1)
{
@bozhink
bozhink / deexec.sh
Created March 3, 2017 15:17
*nix shell: make all files non-executable
#!/bin/bash
find . -type f -exec chmod -x {} \;
@bozhink
bozhink / remove-empty-directories.sh
Created March 3, 2017 15:16
*nix shell: Delete empty directories
#!/bin/bash
find . -type d -empty -delete
@bozhink
bozhink / set-transaction-isolation-level.sql
Created February 19, 2017 10:25
Set transaction isolation level in TSQL
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
@bozhink
bozhink / ps-functions-with-code-completion.psm1
Created February 17, 2017 20:33
PowerShell: functions with code completion
<#
Import-Module *.psm1
#>
function Select-Color
{
param
(
[System.ConsoleColor]
$Color
)