Skip to content

Instantly share code, notes, and snippets.

View spangenberg's full-sized avatar
🦄

Daniel Spangenberg spangenberg

🦄
View GitHub Profile
import java.util.*;
class Aufgabe1 {
public static void main(String[] args) {
int out = 0;
System.out.println("Dieses Programm berechnet die Partialsummenfolge einer Zahl\n");
System.out.print("Zahl = ");
private int[] a;
private int n;
public void sort(int[] a)
{
this.a = a;
n = a.length;
quicksort(0, n - 1);
}
import java.util.*;
class Untitled {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Integer number = scanner.nextInt();
kaprekar(number);
}
public static boolean kaprekar(Integer numberInteger) {
<?php
// Production
// APNs Push testen auf Token
$deviceToken = "XXX";
// Payload erstellen und JSON codieren
$payload['aps'] = array('alert' => 'Hello World!', 'badge' => 1, 'sound' => 'default');
$payload = json_encode($payload);
$apnsHost = 'gateway.push.apple.com';
//alert( localStorage.site );
gApp = new Array();
gApp.deviceready = false;
gApp.c2dmregid = '';
window.onbeforeunload = function(e) {
if ( gApp.c2dmregid.length > 0 )
{
@spangenberg
spangenberg / boxee.rb
Created March 14, 2012 12:53
Convert file names of movies to the right form for Boxee with informations from IMDb
# encoding: UTF-8
require 'net/http'
require 'json'
module Boxee
class Rename
class File
attr_reader :path, :name, :extension, :part, :canonical
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<button onclick="login()">Login</button>
<button onclick="me()">Me</button>
<!--<button onclick="getSession()">Get session</button>-->
<button onclick="getLoginStatus()">Get login</button>
<button onclick="logout()">Logout</button>
FB.init({ appId: "1234", nativeInterface: CDV.FB, useCachedDialogs: false });
FB.login(function(response) {
if (response.session) {
alert('logged in');
} else {
alert('not logged in');
}
}, { scope: "publish_stream" });
FB.api('/me/feed', 'post', {message: "FooBar!});
set -g status-left-length 32
set -g status-right-length 150
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
set -g pane-border-fg colour245
set -g pane-active-border-fg colour39
set -g message-fg colour16
set -g message-bg colour221
# Setting the prefix from C-b to C-a
# START:prefix
set -g prefix C-a
# END:prefix
# Free the original Ctrl-b prefix keybinding
# START:unbind
unbind C-b
# END:unbind
#setting the delay between prefix and command
# START:delay