Skip to content

Instantly share code, notes, and snippets.

View sargunv's full-sized avatar

Sargun Vohra sargunv

View GitHub Profile
@sargunv
sargunv / empty-json-schema.json
Created December 5, 2022 18:44
empty json schema
{}

I've found a bug in the jpackage tool early access which I obtained from https://jdk.java.net/jpackage/. The issue is that the icon path is incorrect in the generated desktop entry file.

Steps to reproduce the bug in Ubuntu are as follows:

I have a project in which I create an app image with the command:

jpackage create-app-image --output build/jpackage --name modsman-gui --module-path build/jlinkbase/jlinkjars --module modsman.gui/modsman.gui.MainKt --runtime-image build/image --icon icons/linux.png  
val spec = ApiSpec {
title = "Sample API"
description = "Sample API description"
basePath = "/v1"
contentTypes = mapOf(
"application/json" to JsonSerializer(),
"application/x-yaml" to YamlSerializer()
@sargunv
sargunv / DropTest.kt
Created January 27, 2016 05:20
Kotlin sequence drop problem tester
import com.github.andrewoma.kommon.util.StopWatch
import java.util.concurrent.TimeUnit
class Squares(val length: Long): Iterable<Long>, Sequence<Long> {
override fun iterator() = object : Iterator<Long> {
var current: Long = 0
override fun hasNext() = current < length
override fun next() = Math.pow(current++.toDouble(), 2.toDouble()).toLong()
}
@sargunv
sargunv / .gitignore
Last active January 20, 2016 03:19
CS 456 Lab1 .gitignore
### Project ###
# The compiler itself
scc
# generated lex and yacc files
lex.yy.c
y.tab.?
# the output progs for the simple test cases
@sargunv
sargunv / AnkoSupportLibrary.kt
Last active February 13, 2017 14:10 — forked from mgranberry/DesignSupport.kt
A set of Anko-compatible extensions for Google's support libraries
import android.app.Activity
import android.support.design.widget.*
import android.support.v4.app.Fragment
import android.support.v4.view.PagerTabStrip
import android.support.v4.view.PagerTitleStrip
import android.support.v4.view.ViewPager
import android.support.v4.widget.DrawerLayout
import android.support.v4.widget.SlidingPaneLayout
import android.support.v7.widget.CardView
import android.support.v7.widget.GridLayout
@sargunv
sargunv / validateyoutube.php
Last active July 12, 2017 09:35
Validate a YouTube video ID
<?php function validate_youtube($videoid) { return strpos ( get_headers ( "http://gdata.youtube.com/feeds/api/videos/" . $videoid, 1) [0], '200') !== FALSE; } ?>