Skip to content

Instantly share code, notes, and snippets.

View nikos's full-sized avatar

Niko Schmuck nikos

View GitHub Profile
@deas
deas / DBBFSearch.groovy
Created March 23, 2012 13:58
Generic Brute Force SQL Search - Groovy Style
#!/usr/bin/env groovy
/*
* deas - http://www.contentreich.de/generic-brute-force-sql-search-groovy-style
*
* Created on Mar 15, 2012
*
* 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
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 26, 2024 18:34
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@theotherian
theotherian / ClientFactory.java
Last active July 23, 2020 11:21
configuring Jersey 2 client
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import org.apache.http.HttpHost;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
import org.glassfish.jersey.apache.connector.ApacheClientProperties;
import org.glassfish.jersey.apache.connector.ApacheConnector;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.ClientProperties;
@soofaloofa-zz
soofaloofa-zz / On choosing a hypermedia type
Last active October 14, 2023 07:23
On choosing a hypermedia type for your API - HAL, JSON-LD, Collection+JSON, SIREN, Oh My!
A comparison of Collection+JSON, HAL, JSON-LD and SIREN media types.
Discussion at
http://sookocheff.com/posts/2014-03-11-on-choosing-a-hypermedia-format/
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

@nikos
nikos / Dockerfile
Last active August 29, 2015 14:10
MarkLogic Server 8 EA Dockerfile
# Requirements:
# - download MarkLogic EA 8 (MarkLogic-8.0-20141124.x86_64.rpm) into
# same directory like this Dockerfile
#
# Build your own image:
# docker build -t centos-marklogic8 .
#
# Start a new container with this image:
# docker run -p 8000:8000 -p 8001:8001 centos-marklogic8
@jstaffans
jstaffans / clojured_2015.md
Last active August 29, 2015 14:14
ClojureD notes

Notes from ClojureD 24.1.2015

Albrecht Schmidt: "Start your engine: My Clojure Bot in the Hello World Open 2014"

  • Hello World Open: programming contest organised by Reaktor and Supercell with ~2500 teams, worldwide distribution
    • Client-server car race, cards driven with some parameters such as decelerate/accelerate, change lanes
    • Organisers provided test server with simple testing UI
  • Parameters for car are quite simple: current angle, position etc
  • Clojure works well for processing simple data structures like this - analysis, storing, examining
  • Used Incanter to plot bot data during test (throttles vs. angles)
@joost
joost / resize_boot2docker.sh
Last active December 14, 2022 07:34
Resize boot2docker VirtualBox image
# Steps we will take:
# 1. Change boot2docker image type (this will take long)
# 2. Resize image
# 3. Resize partion (using GParted)
#
# Also see: https://docs.docker.com/articles/b2d_volume_resize/
# Stop boot2docker
boot2docker stop
@protrolium
protrolium / ffmpeg.md
Last active July 23, 2024 06:07
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@Deraen
Deraen / 00_notes.md
Last active October 1, 2019 08:40
Compojure-api and Buddy
  • (:identity req) is auth backend independent way to access user data
  • login and logout implementation depends on auth backend
  • :current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required