Skip to content

Instantly share code, notes, and snippets.

View dhlavaty's full-sized avatar

Dusan Hlavaty dhlavaty

View GitHub Profile
using System;
using System.Globalization;
using System.Text;
namespace TC
{
// Removes diacritics from a string
//
// Original version by Michael Kaplan:
// -> http://blogs.msdn.com/b/michkap/archive/2007/05/14/2629747.aspx
@dhlavaty
dhlavaty / ZendeskCreateTicket.cs
Created August 26, 2013 12:30
Create new Zendesk.com ticket - simplest possible C# code
using System;
using System.IO;
using System.Net;
using System.Text;
namespace DHlavaty
{
public class Zendesk
{
/*
@dhlavaty
dhlavaty / CSVParser.cs
Created October 2, 2013 11:50
Simple CSV parser in C#
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
@dhlavaty
dhlavaty / toLiteral.js
Last active May 24, 2016 10:07
Very naive Atom script to convert string concatenation to EcmaScript 6 template literals - for fixing ESLint 'prefer-template' rules
function toLiteral() {
var t = atom.workspace.getActiveTextEditor().getSelectedText();
t = t.replace(/\' \+ /g, "${");
t = t.replace(/ \+ \'/g, "}");
if (t.indexOf("'") == 0) {
t = t.substring(1);
} else {
t = "${" + t;
@dhlavaty
dhlavaty / color-difference-calulation.scss
Created May 30, 2017 11:25
SASS color difference calculations
// Use https://www.sassmeister.com/ to try it out
$have: #dfe2e5;
$need: #e1e4e6;
//$need: #d8dbe1;
//$out: saturate(darken($have, 2.15), 2.7);
$out: desaturate(lighten($have, 0.58), 1.25);
@dhlavaty
dhlavaty / go-lang-factorization-tests-multithreaded.go
Last active October 23, 2017 13:22
Factorization test in golang
package main
import (
"fmt"
"math/big"
"sync"
)
func runInThread(wg *sync.WaitGroup, startFrom int64, numOfIterations int64) {
defer wg.Done()
@dhlavaty
dhlavaty / electrum-tails.md
Last active June 27, 2018 07:17
Installing Electrum-LTC LiteCoin wallet in Tails Live operating system

Installing Electrum-LTC LiteCoin wallet in Tails LiveCD operating system

Tested with Tails 3.8 LiveCD (no persistent storage needed, you have to install it after every reboot) and Electrum-LTC 3.1.3.1.

Changelog (of this document)

2018-06-27

  • updated to Tails 3.8

2018-04-20

@dhlavaty
dhlavaty / fingera-bookmarklet.md
Created September 20, 2018 08:32
Fingera.com - better report bookmarklet

Fingera - better report bookmarklet

Create a new bookmark somewhere in your browser with the following URL:

javascript:(function(){ var last = ''; var color = 'transparent'; $('#list_table_body tr').each(function (index, el) { var actual = $(el).children(":first").text(); if (actual !== last) { color = (color === 'transparent') ? '#eee':'transparent'; } last=actual; $(el).css('background-color', color); }); })(); 
@dhlavaty
dhlavaty / RestApi.cs
Created January 2, 2013 09:54
Simplest method to do a REST API calls in c# with basic .NET classes (no external library needed). I use it when communicationg with Recurly.com REST services.
/*
Simplest method to do a REST API calls in c# with basic .NET classes.
I use it when communicationg with Recurly.com REST services.
*/
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
@dhlavaty
dhlavaty / opencv-windows-installing-howto.md
Created June 10, 2019 08:54
OpenCV prototyping notes