Skip to content

Instantly share code, notes, and snippets.

@criminy
criminy / AbstractJdbcRepository.java
Created September 9, 2011 16:43
Implementation of PagingAndSortingRepository using JdbcTemplate
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
@sartak
sartak / a.md
Last active June 26, 2024 04:59
Anki 2 annotated schema
@cyxou
cyxou / upgrade-jenkins.sh
Created August 11, 2015 10:46
Upgrade Jenkins on Bitnami VM
#!/bin/bash
cd /opt/bitnami
sudo ./ctlscript.sh stop
sudo cp -f apache-tomcat/webapps/jenkins.war apps/jenkins/jenkins.war.bak
sudo wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
sudo mv jenkins.war apache-tomcat/webapps/
sudo rm -rf apache-tomcat/work/Catalina/localhost
sudo rm -rf apache-tomcat/webapps/jenkins
sudo ./ctlscript.sh start
@danijar
danijar / blog_tensorflow_variable_sequence_labelling.py
Last active May 15, 2022 14:28
TensorFlow Variable-Length Sequence Labelling
# Working example for my blog post at:
# http://danijar.com/variable-sequence-lengths-in-tensorflow/
import functools
import sets
import tensorflow as tf
from tensorflow.models.rnn import rnn_cell
from tensorflow.models.rnn import rnn
def lazy_property(function):
@fredriks
fredriks / amazon.sh
Last active July 23, 2024 13:01
postgresql with postgis on amazon linux, debian jessie and ubuntu trusty
# http://stackoverflow.com/questions/27177327/setting-up-django-with-geodjango-support-in-aws-beanstalk-or-ec2-instance
# http://rpmfind.net/linux/rpm2html/search.php?query=lib64jpeg8
# http://rpmfind.net/linux/rpm2html/search.php?query=lib64poppler5
# install postgresql repo
sudo yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-6-x86_64/pgdg-ami201503-95-9.5-3.noarch.rpm
# add priority=1 to perfer this repo over amzn-main
vim /etc/yum.repos.d/pgdg-95-ami201503.repo