Skip to content

Instantly share code, notes, and snippets.

View jschmid's full-sized avatar
📱

Jonas Schmid jschmid

📱
View GitHub Profile
@jschmid
jschmid / uncrustify.cfg
Created August 28, 2014 13:41
My Uncrustify file for Obj-C
indent_oc_block_msg_xcode_style = true
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.4.3 (252)
#
# Alignment
# ---------
@jschmid
jschmid / keybase.md
Created February 26, 2015 07:59
Keybase

Keybase proof

I hereby claim:

  • I am jschmid on github.
  • I am schmid (https://keybase.io/schmid) on keybase.
  • I have a public key whose fingerprint is 8590 A344 C55C 2E07 8D5C 7D87 35C9 7890 C746 5518

To claim this, I am signing this object:

@jschmid
jschmid / index.js
Created July 2, 2015 12:03
How Whatsapp does the app redirection
<script>window.location = "whatsapp://r?c=212687";setTimeout(function(){window.location="http://v.whatsapp.com/212687?s=1";},0);</script>
@jschmid
jschmid / sync.js
Last active August 29, 2015 14:25
Couchbase chat sync function
function(doc, oldDoc) {
if(doc._deleted) {
if(oldDoc.type == "chatroom") {
requireUser(oldDoc.user);
var roomId = oldDoc._id;
var roomMembers = oldDoc.members;
var roomChannel = "room-" + roomId;
channel(roomChannel);
access(roomMembers, roomChannel);
@jschmid
jschmid / docs.json
Created July 16, 2015 09:49
Couchbase chat documents
// A chatroom
{
"members": [
"user2",
"user1",
"user4"
],
"name": "still",
"type": "chatroom",
@jschmid
jschmid / playground.swift
Created September 2, 2015 08:19
Specialized errors
import UIKit
// Specialized error type
public protocol CommandError: ErrorType {}
// A command that does not have specialized errors
public enum NoCommandError: CommandError {}
// The "Authorize" method returns errors
public enum AuthorizeError: CommandError {
@jschmid
jschmid / PostArrayHandler.cs
Last active September 26, 2015 20:18
Handling arrays in POST data with Nancy
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Nancy;
namespace NancyComponents
{
public class PostArrayHandler
{
public static object GetFormWithArrays(dynamic form)
{
@jschmid
jschmid / SecureActivity.java
Created February 1, 2013 07:27
Secure Android Activity that does not allow clicks when in the background, and prevents screenshots.
package pro.schmid.android.secureapp;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
@jschmid
jschmid / AndroidManifest.xml
Created February 1, 2013 07:09
Poll the currently running Android Activity then replace it by our own
<uses-permission android:name="android.permission.GET_TASKS" />
@jschmid
jschmid / AndroidManifest.xml
Last active December 12, 2015 04:18
Android keep screen on
<uses-permission android:name="android.permission.WAKE_LOCK" />