Skip to content

Instantly share code, notes, and snippets.

Imports System
Public Module modmain
Sub Main()
Console.WriteLine ("Hello World using Visual Basic!")
End Sub
End Module
Imports Nest
Imports Dapper
Module Module1
Sub Main()
Dim setting = New ConnectionSettings(New Uri("http://texsrv7:9200")).SetDefaultIndex("cases")
Dim client = New ElasticClient(setting)
Console.WriteLine("Indexing")
Dim stopwatch = New Stopwatch
package org.humanizer.jvm.tests
import org.spek.Spek
import org.spek.givenData
import org.humanizer.jvm.humanize
import org.spek.shouldEqual
import org.humanizer.jvm.dehumanize
import org.humanizer.jvm.milliSecondsToTimespan
public class TimeSpanTests(): Spek() {
I have an enum
enum class ShowQuantityAs
{
None
Numeric
Words
}
I use it like this
fun String.pluralize() : String{
val rules = listOf(
"$" to "s",
"s$"to "s",
"(ax|test)is$" to "$1es",
"us$" to "i",
"(octop|vir)us$" to "$1i",
"(octop|vir)i$" to "$1i",
"(alias|status)$" to "$1es",
"(bu)s$" to "$1ses",
val data = listOf(
-1 to "one second ago",
-10 to "10 seconds ago",
-59 to "59 seconds ago",
-60 to "a minute ago",
1 to "one second from now",
10 to "10 seconds from now",
59 to "59 seconds from now",
60 to "a minute from now"
)
package org.humanizer.jvm.tests
import org.junit.Test as Test
import kotlin.test.assertEquals
import java.util.ArrayList
import java.util.HashMap
import org.spek.*
import org.humanizer.jvm.humanize
import java.util.Calendar
import java.util.Date
package org.humanizer.jvm
import org.junit.Test as Test
import kotlin.test.assertEquals
import java.util.Calendar
import java.util.Date
public class DateHumanizerTests() {
fun humanizeDatAssert(difference: Int, expected: String)
package be.baes
import org.wasabi.app.AppServer
import org.wasabi.app.AppConfiguration
import org.wasabi.interceptors.parseContentNegotiationHeaders
fun main(args: Array<String>) {
val config = AppConfiguration(4000, "This is me on port 4000", true)
val server = AppServer(config)
@chrissie1
chrissie1 / gist:5458274
Created April 25, 2013 08:17
Hanselman newsletter thing
<td align="left" valign="top" class="content_bg3">
<table width="100%" cellspacing="5" cellpadding="5" border="0" bordercolor="#636531" height="250">
<tr>
<td align="left" valign="top" class="content_bg3">
<font class="content_text"><p>Hi Interfriends,</p>
<p>Thanks again for signing up for this experiment. Here's some interesting things I've come upon this week. If you forwarded this (or if it was forwarded to you) a reminder: You can sign up at <a href="http://hanselman.com/newsletter">http://hanselman.com/newsletter</a> and the <a href="http://www.hanselman.com/blog/CategoryView.aspx?category=Newsletter">archive of all previous Newsletters is here</a>.</p>
<p>Remember, you get the newsletter here first. This one will be posted to the blog as an archive in a few weeks. </p>