Skip to content

Instantly share code, notes, and snippets.

View Xennis's full-sized avatar
🚀
rocketing

Fabian Rosenthal Xennis

🚀
rocketing
View GitHub Profile
<?php
/**
* Interpretiert den "User Agent" des Browser richtig.
*
* Supported Browser: Chrome, Firefox, IE, Opera, Safari
*
*/
class x11_detectBrowser
{
@Xennis
Xennis / ApacheHttpClient.java
Last active November 11, 2016 13:38
Java HTTP Client (httpGet and httpPost with OAuth)
package org.example.sampleapi;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
@Xennis
Xennis / HttpClient.js
Last active July 17, 2020 22:08
JavaScript jQuery HTTP Client
/*
* Perform an asynchronous HTTP (Ajax) request.
*/
(function ($, undefined) {
window.HttpClient = function() {
}
HttpClient.prototype = {
httpPost: function (url, authorization, data, success_callback, fail_callback) {
@Xennis
Xennis / alleMeineEntchen.nqc
Created March 1, 2014 15:39
Lego Spybot - "Alle meine Entchen" (NQC (Not Quite C))
/*
* Platform: Lego Spybot
* Version: 1.0
* Author: Xennis
* Doc: http://xennis.org/wiki/Lego_Spybot_-_Alle_meine_Entchen
*/
#define __NOTETIME 10
#define __WAITTIME 12
#define turn_right(s,t) SetPower(OUT_AB,s);OnFwd(OUT_A);OnRev(OUT_B);Wait(t);
#!/bin/bash
BASEDIR=`dirname $0`
# --------------------------- Settings ----------------------------
USER=root
HOST=
# --------------------------- Include gernal scripts ------------------------
#source general_functions.sh
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LaTeX_Vorlage_Uebungsblatt.tex
% Source: https://gist.github.com/Xennis/9637696
% Documentation: https://gist.github.com/Xennis/9637696#file-readme-md
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt,a4paper]{exercisesheet}
% ------------------------- packages ------------------------------------------
% encoding and language
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ]
@Xennis
Xennis / google-maps-js_radius_from_meters_to_pixels.js
Last active November 7, 2023 13:20
Google Maps JS API - Convert a radius from meters to pixels
/**
* Google Maps JavaScript API - Convert a radius given in meters to the
* corresponding number of pixel.
*
* ### Credits:
*
* "JS Bin - rorecuce",
* http://jsbin.com/rorecuce/1/edit
*
* Example "Showing pixel and tile coordinates",
private void enableHTML5AppCache() {
webView.getSettings().setDomStorageEnabled(true);
// Set cache size to 8 mb by default. should be more than enough
webView.getSettings().setAppCacheMaxSize(1024*1024*8);
// This next one is crazy. It's the DEFAULT location for your app's cache
// But it didn't work for me without this line
webView.getSettings().setAppCachePath("/data/data/"+ getPackageName() +"/cache");