Skip to content

Instantly share code, notes, and snippets.

@rplantiko
rplantiko / dpl.sh
Last active December 11, 2017 11:13
Delete Mozilla Firefox' .parentlock
#!/bin/bash
HOME=/data/nethome
USER=$1
if [ $# -ne 1 ]; then echo "=========================================================
Löschen der Firefox-Sperrdatei .parentlock für einen User
=========================================================
Verwendung:
// A bitfield represents a binary number of arbitrary length
// This implementation requires the JavaScript Uint32Array data type
function BitField(length,data) {
if (length instanceof BitField) {
// Copy-Constructor from a given BitField
this.length = length.length
this.maxIndex = length.maxIndex
this.maxMask = length.maxMask
this.maxPlaces = length.maxPlaces
this.data = Uint32Array.from(length.data)
package loginServices;
import com.sap.security.core.logon.imp.SAPJ2EECallbackHandler;
import com.sap.engine.interfaces.security.auth.LoginContextFactory;
import java.io.IOException;
import java.io.PrintWriter;
import javax.security.auth.login.LoginContext;
import javax.security.auth.login.LoginException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
#include "fcgi_stdio.h"
#include <unistd.h>
#include <setjmp.h>
#include <stdbool.h>
#include "../../swisseph/src/swephexp.h"
const char* EPHE_PATH = "/usr/swisseph/ephe";
const int MAXLEN_EPHE_PATH = 132;
/*
ephemeris via fastcgi
See http://swepar.blogspot.ch/2015/07/ein-exkurs-fast-cgi.html
*/
#include "ephemeris.h"
int main (int argc, char** argv) {
#include "fcgi_stdio.h"
#include <unistd.h>
void print_numbers( double* numbers, int n) {
for (int i=0;i<n;i++) {
printf("%s%.4lf",i>0?",":"",numbers[i]);
}
printf("\r\n");
}
@rplantiko
rplantiko / gist:b92f0231c4e149bf75aa
Created July 10, 2015 10:37
XML beautifier with attribute alignment
/* global process */
// A simple xml beautifier, based on the xml2js parser
// - align attribute names (this is what xmlbuilder can't do)
// - indent by 2 spaces
// Don't expect too much:
// xml2js can't handle mixed element content:
// <a>b<c/>d</a> is equal to <a>bd<c/></a> in the eyes of xml2js
@rplantiko
rplantiko / eslint-rules.json
Last active August 29, 2015 14:22
JavaScript - additional ESLint rules
{
"basevalidator": {
"validators": [
{
"validatorID": "jsValidator",
"configuration": {
"eslintConfig": {
"rules": {
"block-scoped-var": 2,
"brace-style": 0,
@rplantiko
rplantiko / json2data.abap
Created April 2, 2012 11:48 — forked from mydoghasworms/json2data.abap
Added some module tests
REPORT ZZ_TEST_JSON_MYDOG.
*
class lcl_test definition for testing " #AU Risk_Level Harmless
inheriting from cl_aunit_assert. " #AU Duration Short
private section.
methods :
test_string for testing,
test_number for testing,