Skip to content

Instantly share code, notes, and snippets.

@arsenik
arsenik / list_days.php
Last active June 7, 2018 10:43
Generate a list of dates for a given date range
<?php
$s = '2018-01-25';
$e = '2018-02-26';
$interval = \DateInterval::createFromDateString('1 day');
$start_datetime = new \DateTime($s);
$end_datetime = new \DateTime($e);
$date_period = new \DatePeriod($start_datetime, $interval, $end_datetime->add(new DateInterval('P1D')));
$dates = array();
@arsenik
arsenik / render_list_geo.pl
Created October 10, 2017 20:17
Perl script for automatic rendering OSM tiles for renderd+mod_tile with using geographic coordinates (WGS-84)
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Std;
use Math::Trig;
my $options = {};
getopts("n:l:m:x:X:y:Y:z:Z:h", $options);
if ($options->{h}) {
@arsenik
arsenik / vim-find-and-replace
Last active March 23, 2017 12:22
Linux cheatsheet
:%s/old-text/new-text/g
@arsenik
arsenik / App.java
Created July 19, 2015 14:45
JMS Consumer ApacheMQ
package com.jlevasseur.consumer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class App {
public static void main( String[] args ) {
ApplicationContext ctx = new ClassPathXmlApplicationContext("app-context.xml");
@arsenik
arsenik / App.java
Last active August 29, 2015 14:25
JMS send message to ActiveMQ
package com.jlevasseur.app;
import javax.jms.Queue;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class App
{
@arsenik
arsenik / logback.xml
Last active August 29, 2015 14:12 — forked from uarun/logback.xml
slick enable sql output
<logger name="scala.slick.jdbc.JdbcBackend.statement" level="DEBUG" />