Skip to content

Instantly share code, notes, and snippets.

View andirady's full-sized avatar
🏠
Working from home

andirady

🏠
Working from home
View GitHub Profile
{
"kamus": {
"adalah":"اداله", "ambil":"امبيل", "asal":"اصل", "lancar":"لنچر", "majlis":"مجليس",
"bahasa":"بهاس", "bahawa":"بهاوا", "banyak":"باڽق", "bagai":"باݢاي", "bebas":"بباس",
"berita":"بريتا", "biografi":"بيوݢرفي", "boleh":"بوليه", "buah":"بواە", "bukan":"بوکن",
"belum":"بلوم",
"dalam":"دالم", "dan":"دان", "dapat":"داڤت", "dari":"دري", "datang":"داتڠ",
"dengan":"دڠن", "di":"د", "dikit":"ديکيت", "dia":"دي",
"ensiklopedia":"اينسيکلوڤيديا",
"falsafah":"فلسفه", "filem":"فيلم",
@andirady
andirady / hello.java
Last active December 18, 2021 14:18
Hello world jshell
System.out.println("Hello world!")
@andirady
andirady / Makefile
Last active September 17, 2021 23:25
xmlformatter-native-image
JAR=xmlformatter.jar
XmlFormatter.class: XmlFormatter.java
javac XmlFormatter.java
$(JAR): XmlFormatter.class formatter.xlst
jar --create --file $(JAR) --main-class=XmlFormatter XmlFormatter.class formatter.xlst
cfg: $(JAR)
java -agentlib:native-image-agent=config-output-dir=cfg -jar $(JAR) test.xml
@andirady
andirady / hello.java
Last active September 17, 2021 23:43
Run Java as a script. Requires Java > 9
///usr/bin/env java $0 $@; exit
public class hello {
public static void main(String[] args) {
System.out.println("I'm a script! Or am I? 😉");
}
}
/* to run it, execute a follows:
$ ./hello.java
*/
@andirady
andirady / build.xml
Created April 24, 2020 14:40
Use ant+ivy to build java project without having to perform dependency resolution on every compilation.
<project name="test" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="src.dir" value="src/main/java" />
<property name="build.dir" value="build" />
<property name="classes.dir" value="build/main/classes" />
<target name="resolve">
<ivy:cachepath pathid="lib.path.id" />
<echo file="classpath.properties">compile.classpath=${toString:lib.path.id}</echo>
</target>
@andirady
andirady / Calendar.svelte
Created June 11, 2019 07:04
Calendar component using sveltejs
<script>
const ONE_DAY = 24*60*60*1000;
const DAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
export
let date, month, year;
function getCalendar(year, month) {
var first = new Date(year, month);
var cells = [];
@andirady
andirady / alias.js
Last active April 7, 2018 07:22
Aliases for JS methods
function $(a,b) {
if (b === undefined)
return document.querySelector(a);
return a.querySelector(b);
}
function $$(a,b) {
if (b === undefined)
return document.querySelectorAll(a);
return a.querySelectorAll(b);