Skip to content

Instantly share code, notes, and snippets.

@easyaspi314
easyaspi314 / FooActivity.java
Created December 8, 2014 19:28
How to get the Menu key working in AppCompat
package foo.bar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Menu;
public class FooActivity extends ActionBarActivity {
private Toolbar toolbar;
@easyaspi314
easyaspi314 / MainActivity.java
Created February 8, 2015 18:26
Android WebView code that works with Facebook's image scaling.
package com.example.facebookwebview;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.example.facebookwebview.R;
import android.view.Window;
@easyaspi314
easyaspi314 / OS Preferences.md
Created September 17, 2016 07:28
My OS preferences

My personal OS preferences

I am an Android only guy, and prefer Macs, but is is very close and I can literally use any computer you throw at me.

Why I prefer Android:

Features iPhones don't have:

  • A goddamn file manager without the need of jailbreaking/root
  • You can download, upload, and often view any file
  • GBA emulators (screw you PoGo players, I'm playing FireRed!)
  • Real Firefox, not that lame Safari disguise.
@easyaspi314
easyaspi314 / troll.bbcode
Last active December 21, 2017 20:45
How to break Pokécommunity (and other BBCode forums which allow CSS)
Click and be trolled by the power of unsanitized CSS!
<!--
This shows a troll face that completely covers the screen when you unhide the spoiler.
**** This is mainly a proof of concept; if you actually post this, don't be surprised if mods get angry! ****
Basically, some BBCode-based forums have a [div][/div] or [style][/style] tag which allows custom CSS.
This takes full advantage of that and CSS's position: fixed, which positions the element in relation to the
browser window, not the parent element.
@easyaspi314
easyaspi314 / README.md
Last active October 4, 2018 21:03
Overcomplicated ShowNum assignment

ShowNum

A completely overcomplicated way to do my homework assignment.

The assignment

Write a Java class (called ShowNum) that displays the same number of asterisks (row and columns) as is input in 2 numbers. 
Your class should have a default constructor (number1 is 0, number2 is 0) and 
another constructor that inputs 2 numbers (integers). 
You'll need accessor methods for the numbers and a display method that displays as follows:
@easyaspi314
easyaspi314 / setup.sh
Last active October 26, 2018 02:33
easyaspi314's agbcc and pokeruby build script for Termux
#!/data/data/com.termux/files/usr/bin/sh
note() {
printf "\033[1m%s\n\033[0m" "$1" >&2
}
die() {
printf "%b\n" <<EOF >&2
\033[31;1mDamn it! \033[0;1m$1
You should be able to find a log in ~/agbcc-build-log.txt.
@easyaspi314
easyaspi314 / hash_map.c
Last active November 24, 2018 07:57
My failed attempt at a hash map.
/* Copyright (C) 2018 easyaspi314
* MIT license.
* Please don't use this code, it is BAD.
* Use an actual hash map. Please.
*/
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <stdint.h>
@easyaspi314
easyaspi314 / unit.post.clang3.9.c
Created November 25, 2018 16:01
c99conv output unit test 1
# 1 "unit.c"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 360 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "unit.c" 2
@easyaspi314
easyaspi314 / cppcheck output
Created January 27, 2019 22:44
cppcheck bug
$ cppcheck --enable=style uint128mul.c
Checking uint128mul.c ...
[uint128mul.c:9]: (style) The scope of the variable 'botLo' can be reduced.
@easyaspi314
easyaspi314 / cppcheck output
Created January 27, 2019 23:03
cppcheck output 2
[pragma.c:4]: (style) The scope of the variable 'bar' can be reduced.
[pragma.c:7]: (style) Variable 'bar' is assigned a value that is never used.