Skip to content

Instantly share code, notes, and snippets.

View pocmo's full-sized avatar
🚀
Just passing by.

Sebastian Kaspari pocmo

🚀
Just passing by.
View GitHub Profile
#!/usr/bin/ruby
# Brainfuck Interpreter
# (C) Sebastian Kaspari 2009
# Usage: bf2 [FILE]
require 'rubygems'
require "highline/system_extensions"
include HighLine::SystemExtensions
code = ARGF.read # code
#!/usr/bin/ruby1.9.1
# Brainfuck Interpreter
# (C) Sebastian Kaspari 2009
# Usage: bf4 [FILE]
# This code is much much faster than the last one, which did
# a lot of unnecessary loops which could also lead to bugs
#
# There's now a bracket map which stores starting and ending
# brackets for direct "jumps", that should speed up things too
@pocmo
pocmo / DeckView Demo (Deckster.java)
Created January 8, 2010 18:32
Demo of "DeckView" for Android, see Video at: http://www.youtube.com/watch?v=sv74m0Mcmms
package org.yaaic.deckster;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Display;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Gallery;
@pocmo
pocmo / netbeans_php_colors.xml
Created April 18, 2011 14:10
Netbeans like PHP colors for IntelliJ IDEA 10
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="netbeans_php_colors" version="1" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Monospaced" />
<colors />
<attributes>
<option name="CUSTOM_LINE_COMMENT_ATTRIBUTES">
<value>
<option name="FOREGROUND" value="808080" />
@pocmo
pocmo / ViewPagerAdapter.java
Created October 21, 2012 15:02
ViewPagerAdapter: Implementation of PagerAdapter that represents each page as a View
/*
* Copyright (C) 2012 Sebastian Kaspari
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@pocmo
pocmo / CursorFragmentPagerAdapter.java
Created November 21, 2012 10:08 — forked from peterkuterna/CursorFragmentPagerAdapter.java
A FragmentPagerAdapter that exposes data from a Cursor
package com.example;
import android.content.Context;
import android.database.Cursor;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.SparseIntArray;
import android.view.ViewGroup;
import android.provider.BaseColumns;
@pocmo
pocmo / build.gradle
Created September 6, 2013 08:38
(Android) Gradle: Copy native libraries into final APK
// Tested with gradle 1.7 and android plugin 0.5.6
// [..] Your gradle build script
// Copy *.so files from libs/ folder of your project to native-libs folder
// Adjust if your native libraries are somewhere else..
task copyNativeLibs(type: Copy) {
from(new File(project(':yourproject').projectDir, 'libs')) { include '**/*.so' }
@pocmo
pocmo / gist:c30d2a0ef5967bf4116c
Created March 14, 2015 23:06
Mozilla Robocop Alias
# Alias for building and running robocop tests:
# robocop <test>
function robocop_test {
./mach build build/mobile/robocop
./mach robocop $1
}
alias robocop=robocop_test
@pocmo
pocmo / permissions-lollipop.txt
Last active December 8, 2016 14:28
Android Lollipop - Permissions + Groups + Protection Level
(android.permission-group.MESSAGES) android.permission.SEND_SMS dangerous
(android.permission-group.MESSAGES) android.permission.SEND_RESPOND_VIA_MESSAGE <unknown>
(android.permission-group.MESSAGES) android.permission.RECEIVE_SMS dangerous
(android.permission-group.MESSAGES) android.permission.RECEIVE_MMS dangerous
(android.permission-group.MESSAGES) android.permission.CARRIER_FILTER_SMS <unknown>
(android.permission-group.MESSAGES) android.permission.RECEIVE_EMERGENCY_BROADCAST <unknown>
(android.permission-group.MESSAGES) android.permission.READ_CELL_BROADCASTS dangerous
(android.permission-group.MESSAGES) android.permission.READ_SMS dangerous
@pocmo
pocmo / gist:bc95238e890a185003c4
Last active November 24, 2019 14:24
Android M-Preview 1 - Permissions + Groups + Protection Level
(android.permission-group.CONTACTS) android.permission.READ_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_CONTACTS dangerous
(android.permission-group.CONTACTS) android.permission.READ_PROFILE dangerous
(android.permission-group.CONTACTS) android.permission.WRITE_PROFILE dangerous
(android.permission-group.CALENDAR) android.permission.READ_CALENDAR dangerous
(android.permission-group.CALENDAR) android.permission.WRITE_CALENDAR dangerous
(android.permission-group.SMS) android.permission.SEND_SMS dangerous
(android.permission-group.SMS) android.permission.RECEIVE_SMS dangerous
(android.permission-group.SMS) android.permission.READ_SMS dangerous
(android.permission-group.SMS) android.permission.RECEIVE_WAP_PUSH dangerous