Skip to content

Instantly share code, notes, and snippets.

View xeraa's full-sized avatar
🥑
Developer

Philipp Krenn xeraa

🥑
Developer
View GitHub Profile
@xeraa
xeraa / union.json
Created January 13, 2017 23:51
Simulating a union query from SQL in Elasticsearch
DELETE my_index
PUT my_index
{
"mappings": {
"my_type": {
"properties": {
"type": {
"type": "keyword"
}
GET /raffle/_search
{
"size": 1,
"query": {
"function_score": {
"functions": [
{
"random_score": { }
}
],
Verifying that +xeraa is my blockchain ID. https://onename.com/xeraa
@xeraa
xeraa / helper.rb
Created August 4, 2015 23:48
Middleman: Fully automated alternate language links
# Returns a hash of localized paths for a given page
def localized_paths_for(page)
localized_paths = {}
(langs).each do |locale|
# Loop over all pages to find the ones using the same templates (proxied_to) for each language
sitemap.resources.select do |resource|
if resource.proxied_to == page.proxied_to && resource.metadata[:options][:lang] == locale
localized_paths[locale] = resource.url
break
@xeraa
xeraa / silverstripe-nginx
Created October 3, 2014 12:49
nginx configuration for SilverStripe 3
error_page 404 /assets/error-404.html;
error_page 500 /assets/error-500.html;
location / {
try_files $uri @silverstripe;
}
location @silverstripe {
fastcgi_keep_conn on;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
### Keybase proof
I hereby claim:
* I am xeraa on github.
* I am xeraa (https://keybase.io/xeraa) on keybase.
* I have a public key whose fingerprint is 9254 E53A BB94 A09A A698 522D A938 3B28 6A71 0E7D
To claim this, I am signing this object:
error_page 404 /assets/error-404.html;
error_page 500 /assets/error-500.html;
location / {
try_files $uri @silverstripe;
}
location @silverstripe {
fastcgi_keep_conn on;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#!/bin/bash
# Check if our important or publicly communicated URLs are available
set -e
URLS=(
"http://test.com"
"http://test.com/foo"
)
@xeraa
xeraa / gist:5259749
Created March 28, 2013 01:31
First ViennaDB Meetup
@xeraa
xeraa / gist:4504389
Last active December 10, 2015 22:48
Using JCE in Cloudbee's Jenkins Builds

Adding JCE Support to OpenJDK Builds in Cloudbee's Jenkins

  1. Download the JCE extension from http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html
  2. Upload the files inside the archive to your private repository on Cloudbees forge ( /private/jce/ ) so that you have /private/jce/local_policy.jar,...
  3. On the Jenkins configuration page ([https://YourAccountName.ci.cloudbees.com/configure](https://.ci.cloudbees.com/configure) (use your real account name / subdomain) create a new JDK Installation and set JAVA_HOME to $HOME/openjdk6.unlimited (or any other version you want to use).
  4. Add a Pre Step and add the following shell script. First, it copies the JDK version you are using to your home folder. Second, it patches your copy - this should copy local_policy.jar and US_export_policy.jar. Be sure to use your real account name / subdomain.

if