Skip to content

Instantly share code, notes, and snippets.

Avatar

zygimantus zygimantus

View GitHub Profile
@zygimantus
zygimantus / LT_symbols.ahk
Created May 29, 2018
Some hotkeys for Lithuanian symbols
View LT_symbols.ahk
!9::
Send {U+201E}
return
!0::
Send {U+201C}
return
!-::
Send {U+2013}
View module_pattern_init.js
// JS Module Pattern:
// http://j.mp/module-pattern
// Redefine: $, window, document, undefined.
var APP = (function($, window, document, undefined) {
// Automatically calls all functions in APP.init
$(document).ready(function() {
APP.go();
});
@zygimantus
zygimantus / MainServlet.java
Created Dec 12, 2016
Simple Maven and Jetty Application
View MainServlet.java
package com.zygimantus;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {""})
public class MainServlet extends HttpServlet {
@zygimantus
zygimantus / xmlToJson.xslt
Created Nov 8, 2016
XML to JSON using XSLT
View xmlToJson.xslt
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8"/>
<xsl:template match="/*[node()]">
<xsl:text>{</xsl:text>
<xsl:apply-templates select="." mode="detect" />
<xsl:text>}</xsl:text>
</xsl:template>
@zygimantus
zygimantus / frontendDevlopmentBookmarks.md
Created May 27, 2016 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
View frontendDevlopmentBookmarks.md
@zygimantus
zygimantus / gist:5bbc258122bf081b371685680eff650d
Created May 27, 2016 — forked from voyeg3r/gist:1547918
The ultimate Arch Linux install script
View gist:5bbc258122bf081b371685680eff650d
#!/bin/bash
#-------------------------------------------------------------------------------
#Created by helmuthdu mailto: helmuthdu[at]gmail[dot]com
#Inspired by Andreas Freitag, aka nexxx script
#-------------------------------------------------------------------------------
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
View timeseries-analysis.js
var _ = require("underscore");
var gimage = require('google-image-chart').charts;
var timeseries = function(data, options) {
/*
Data Format:
[
[Date Object, value],
[Date Object, value]
]
View GetComponentsByType.java
// map for components
Map<Class, String> map = new HashMap<Class, String>() {
private static final long serialVersionUID = 1L;
{
put(Controller.class, "controller");
put(Service.class, "service");
}
};
View ExecuteSqlFromResource.java
public final int executeSqlFromResource(String fileName) {
try {
BufferedReader in = new BufferedReader(
new InputStreamReader(
getClass()
.getClassLoader()
.getResourceAsStream(fileName)));
LineNumberReader fileReader = new LineNumberReader(in);
View MapService
<api xmlns="http://ws.apache.org/ns/synapse" name="MapService" context="/MapService">
<resource methods="GET" uri-template="/gettemperature?x={lon}&y={lat}">
<inSequence>
<call>
<endpoint>
<http method="get" uri-template="http://localhost:9765/SimpleMap_1.0.0/services/map/getcity?x={uri.var.lon}&y={uri.var.lat}"></http>
</endpoint>
</call>
<property name="uri.var.city" expression="json-eval($.city)"></property>
<log level="full">