Skip to content

Instantly share code, notes, and snippets.

View wizardjedi's full-sized avatar

Sayapin Alexander wizardjedi

View GitHub Profile
@wizardjedi
wizardjedi / pd.json
Last active February 19, 2017 21:41
package manager example
{
"name":"com.example/library1",
"version":"1.0.0",
"description":"Some library",
"deps":[
"com.example/library2",
"com.example/library3" : "=1.2.1"
],
"classMap":["src/","lib/"],
"repository":{
@wizardjedi
wizardjedi / example.sql
Created February 19, 2017 10:32
SQL Queries for JSqlParser testing
select * from table1;
select * from table1 as tbl;
select * from table1 tbl;
select tbl.* from table1 tbl;
select tbl.* from table1 as tbl;
select id, tbl.name from table1 as tbl;
select `id`, `tbl`.`name` from `table1` as tbl;
select tbl.* from table1 as tbl where tbl.add_date>'2016-01-01' order by tbl.id desc;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@wizardjedi
wizardjedi / telegram_poller_to_webhook.php
Created September 5, 2016 17:30
telegram_poller_to_webhook.php
<?php
global $url;
$url = $_SERVER['argv'][1];
$botId= $_SERVER['argv'][2];
echo "Use url=${url}\n";
echo "Use botId=${botId}\n";
$updateId=0;
<?php
$vars = array(
'CLIENT_LONG_PASSWORD',
'CLIENT_FOUND_ROWS',
'CLIENT_LONG_FLAG',
'CLIENT_CONNECT_WITH_DB',
'CLIENT_NO_SCHEMA',
'CLIENT_COMPRESS',
'CLIENT_ODBC',
@wizardjedi
wizardjedi / gist:2dc474f0fc6e3f60c47d
Created January 26, 2016 11:19
get list of keys with keytool
keytool -v -list -storetype pkcs12 -keystore PassType.p12
@wizardjedi
wizardjedi / gist:f07bde31fae6dce130e7
Created June 22, 2015 15:26
Hibernate Integrator
You could use Jadira's scaffolding for this.
You can subclass AbstractUserTypeHibernateIntegrator from Jadira, and register your Integrator in META-INF/services/org.hibernate.integrator.spi.Integrator in your Jar.
Disclaimer: I maintain Jadira.
http://stackoverflow.com/questions/21020603/hibernate-custom-type-autoregistration
@wizardjedi
wizardjedi / wait_for_docker_port.sh
Created May 24, 2015 17:32
Waiting for port is open. This could be used in docker run scripts.
#!/bin/bash
until nc -z postgres 5432; do
echo "$(date) - waiting for postgres..."
sleep 1
done
@wizardjedi
wizardjedi / pom.xml
Created May 13, 2015 20:38
Reports for maven
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@wizardjedi
wizardjedi / remover.sh
Created April 27, 2015 09:57
PHP echo remover
#!/bin/bash
FROM=$1
sed -r 's/<\?(php)?\s*echo/<?=/' ${FROM} |sed -r 's/<\?=\s*/<?=/g' > 1.out
mv 1.out ${FROM}