Skip to content

Instantly share code, notes, and snippets.

@bitsmuggler
bitsmuggler / gist:8055316
Created December 20, 2013 14:10
Upload file to your Windows Azure Blob Storage (Requires Windows Azure Storage Package v3.0.1.0)
using System;
using System.IO;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;
namespace AzureBlobstorageTest
{
internal class Program
{
private const string url = "<<your url>>";
@bitsmuggler
bitsmuggler / Basiswissen.js
Last active August 29, 2015 14:03
Übung in OOP Workshop @ejs14
var person1 =
{
name : 'test1',
age: 27,
geschlecht: 'm'
};
var person2 =
{
name : 'test2',
@bitsmuggler
bitsmuggler / Type.js
Last active August 29, 2015 14:03
Übung in OOP Workshop @ejs14
/** @constructor */
function Person(name, age, geschlecht) {
this.name = name;
this.age = age;
this.geschlecht = geschlecht;
}
/** Methode */
Person.prototype.getName = function() {
return this.name;
@bitsmuggler
bitsmuggler / Vererbung.js
Last active August 29, 2015 14:03
Übung in OOP Workshop @ejs14
/** @constructor */
function Person(name, age, geschlecht) {
this.name = name;
this.age = age;
this.geschlecht = geschlecht;
}
/** Methode */
Person.prototype.getName = function() {
return this.name;

All of the categories!

I wrote a really simple JavaScript script that uses jQuery to extract all the categories from Facebook's "Create a page" page.

Instructions

  1. Navigate to the Create a page page.
  2. jQuerify the page.
  3. Open up your JavaScript console of choice and run the following script:
@bitsmuggler
bitsmuggler / gist:570a2c0c5575243f6366
Last active August 29, 2015 14:23
AmazoneSNSClientWrapper for Mobile Push Notifications
/*
* Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
@bitsmuggler
bitsmuggler / gist:5bf68faea30f7a3ff34f
Last active August 29, 2015 14:25
Initialize AmazonSNSClient
//Change to your credentials
private final String AwsAccessKeyid = "<<your aws accesskey>>";
private final String AwsSecretKey = "<<your aws secretkey>>";
// Change to your sns-endpoint
private final String SnsEndpoint = "https://sns.eu-west-1.amazonaws.com";
private AmazonSNS sns = null;
//Initializing AmazonSNSClient
@bitsmuggler
bitsmuggler / pushplugin.sh
Created July 24, 2015 09:20
Add Push-Plugin to Cordova Project
cordova plugin add https://github.com/phonegap-build/PushPlugin.git
@bitsmuggler
bitsmuggler / register.js
Last active August 29, 2015 14:25
Register for Push-Notifications
var pushNotification;
// Abonnieren des Ereignisses 'deviceready'
document.addEventListener("deviceready", function(){
pushNotification = window.plugins.pushNotification;
...
});
// Registrierung beim entsprechenden Benachrichtigungsdienst
if ( device.platform === 'android' || device.platform === 'Android'){
@bitsmuggler
bitsmuggler / createAwsTopic.java
Last active August 29, 2015 14:25
Create an aws topic
private String createTopic(String topicName) {
try {
LOGGER.info("Create SNS Topic " + topicName);
CreateTopicRequest request = new CreateTopicRequest(topicName);
CreateTopicResult result = sns.createTopic(request);
// returning topic id
return result.getTopicArn();