Skip to content

Instantly share code, notes, and snippets.

View margusmartsepp's full-sized avatar
😇
It is that simple

Margus Martsepp margusmartsepp

😇
It is that simple
  • Gunvor SA
  • Tallinn
View GitHub Profile
public static class AccountBuilder {
String firstName;
String surname;
String username;
String password;
String phone;
@Override
public String toString() {
return "AccountBuilder [firstName=" + firstName + ", Surname="
21public static class ZooNNDataSet extends NNDataSet {
@Override
public void setTargetColumns() {
targetColumnNumbers = new ArrayList<Integer>();
int size = nds.get(0).size();
targetColumnNumbers.add(size - 1); // last column
targetColumnNumbers.add(size - 2); // last but one column
targetColumnNumbers.add(size - 3); // and the one before that
@margusmartsepp
margusmartsepp / gist:5089683
Last active December 14, 2015 12:58
CSV to JSON stream converter. Use: mono CSVtoJSON.exe "input.csv" "output.json" "optional:delimiter"
using System;
using System.Text;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace CSVtoJSON
{
class MainClass
@margusmartsepp
margusmartsepp / gist:8491194
Created January 18, 2014 14:19
HTML bootstrap pastebin
d
@margusmartsepp
margusmartsepp / mini.html
Last active August 29, 2015 13:57
mini html front end
<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!--[if lt IE 7]><html class="lt-ie9 lt-ie8 lt-ie7" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><![endif]-->
<!--[if IE 7]><html class="lt-ie9 lt-ie8" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><![endif]-->
<!--[if IE 8]><html class="lt-ie9" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><![endif]-->
<!--[if gt IE 8]><!--><html xmlns="http://www.w3.org/1999/xhtml"><!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Maamajanduse võtmeisikud</title>
@margusmartsepp
margusmartsepp / business.html
Created March 28, 2014 13:23
html front end
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<!--[if lt IE 7]><html class="lt-ie9 lt-ie8 lt-ie7" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><![endif]-->
<!--[if IE 7]><html class="lt-ie9 lt-ie8" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><![endif]-->
<!--[if IE 8]><html class="lt-ie9" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><![endif]-->
<!--[if gt IE 8]><!--><html xmlns="http://www.w3.org/1999/xhtml"><!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Maamajanduse võtmeisikud</title>
@margusmartsepp
margusmartsepp / gist:61c3b7b5a380c31f0065
Last active August 29, 2015 14:02
C# new interface method
class Program
{
public interface IPerson { string Speak(); }
public interface IMale : IPerson { string GrowABeard(); new string Speak();}
public interface IFemale : IPerson { string Gossip(); new string Speak();}
public class XY : IMale
{
private string name = "";
public XY(string name) { this.name = name; }
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
namespace AgentImporter
@margusmartsepp
margusmartsepp / App.config
Created August 13, 2014 13:13
Linq to sql code first example
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>