Skip to content

Instantly share code, notes, and snippets.

View alternatex's full-sized avatar
🎯
Focusing

Gianni Furger alternatex

🎯
Focusing
  • Basel, Switzerland
View GitHub Profile
@alternatex
alternatex / k9s-setup.sh
Created June 16, 2022 08:08 — forked from bplasmeijer/k9s-setup.sh
set-up K9S on #WSL2
cd ~
curl -L https://github.com/derailed/k9s/releases/download/v0.21.4/k9s_Linux_x86_64.tar.gz -o k9s
tar -xf k9s
chmod +x k9s
mv ./k9s /usr/local/bin/k9s
k9s
@alternatex
alternatex / README.md
Created April 7, 2019 19:32
Kubernetes Vagrant Setup Using Ansible
@alternatex
alternatex / basicauth.sh
Created February 2, 2014 22:03
Basic Auth // Apache // Helper
#!/bin/bash
# Apache2 Basic Auth Directory Protection Helper
# ===
# Note: `AllowOverride All` must be enabled for the given directory
# gather current directory
cwd=${PWD##*/}
# create directory to store password file
@alternatex
alternatex / MainViewController.m
Created January 12, 2014 01:47
Phonegap + iOS 7: Statusbar Customization
// See: http://stackoverflow.com/questions/19209781/ios-7-status-bar-with-phonegap/19249775#19249775
/*
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
@alternatex
alternatex / json-schema-references.md
Created November 23, 2013 22:24
JSON Schema References
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.*;
public class JsonHelper {
public static Object toJSON(Object object) throws JSONException {
if (object instanceof Map) {
JSONObject json = new JSONObject();
@alternatex
alternatex / README.md
Last active December 22, 2015 04:28
Testing latest rhino release w/requirejs

prerequisites:

git clone https://github.com/mozilla/rhino
cd rhino 
ant compile-all
cd examples

create file test.js in examples directory..

<?php
// Directory iteration helper borrowed from: http://www.php.net/manual/en/directoryiterator.construct.php#95214
/**
* Real Recursive Directory Iterator
*/
class RRDI extends RecursiveIteratorIterator {
/**
* Creates Real Recursive Directory Iterator
@alternatex
alternatex / demo.coffee
Last active December 17, 2015 12:59
URL Object Serialization borrowed from: http://stackoverflow.com/a/9472534
@serialize = (params) ->
pairs = []
do proc = (object=params, prefix=null) ->
for own key, value of object
if value instanceof Array
for el, i in value
proc(el, if prefix? then "#{prefix}[#{key}][]" else "#{key}[]")
else if value instanceof Object
if prefix?
prefix += "[#{key}]"