Skip to content

Instantly share code, notes, and snippets.

@cesco89
cesco89 / aaa
Last active August 29, 2015 13:56
Random test :P
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
@cesco89
cesco89 / Fab.java
Last active August 29, 2015 14:04
Android Floating Action Button (FAB). Based on this: https://github.com/FaizMalkani/FloatingActionButton with a couple of additions
import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
/*
* Copyright (C) 2014 sebnapi
*
* 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
@cesco89
cesco89 / ImplementationSample.java
Created May 11, 2014 13:04
ListView with detectable scrolling direction
list.setOnDetectScrollListener(new OnDetectScrollListener() {
@Override
public void onUpScrolling() {
// TODO Auto-generated method stub
mBottom.setVisibility(View.VISIBLE);
}
@Override
public void onDownScrolling() {
@cesco89
cesco89 / CircularFlipImageView.java
Last active April 5, 2016 15:22
A Circular Flippable ImageView (See README.md for details and credits)
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Camera;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Shader;
@cesco89
cesco89 / ViewPager Crossfade
Created September 22, 2016 22:19
Crossfade effect in Android ViewPager
// Credit goes to http://fiskur.eu/?p=752
public class CrossfadePageTransformer implements ViewPager.PageTransformer {
@Override
public void transformPage(View page, float position) {
int pageWidth = page.getWidth();
View backgroundView = page.findViewById(R.id.background);
View text = page.findViewById(R.id.content);
@echo off
title Activate Microsoft Office 2016 ALL versions for FREE!&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2016&echo - Microsoft Office Professional Plus 2016&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo ============================================================================&ech
@cesco89
cesco89 / Line.java
Created February 8, 2018 12:12
A random java Maze generator
public class Line {
public int posx;
public int posy;
public int dim1;
public int dim2;
public Line (int _posx, int _posy, int _dim1, int _dim2) {
this.posx = _posx;
this.posy = _posy;
@cesco89
cesco89 / Cell.java
Last active February 9, 2018 21:47
Java Maze Generator based on Maze Generation Algorithm --> https://en.wikipedia.org/wiki/Maze_generation_algorithm
import java.awt.*;
import java.util.ArrayList;
public class Cell {
public int i;
public int j;
public int x;
public int y;
public boolean[] walls = {true, true, true, true}; //top, right, bottom, left
@cesco89
cesco89 / GamePanel.java
Last active February 11, 2018 10:11
Java Game of life
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
public class GamePanel extends JPanel implements ActionListener{
Timer timer = new Timer(1, this);
private static int width = Toolkit.getDefaultToolkit().getScreenSize().width;
private static int height = Toolkit.getDefaultToolkit().getScreenSize().height - 100;