Skip to content

Instantly share code, notes, and snippets.

View Bloody-Badboy's full-sized avatar
😪
Wake me up when we can travel again

Arpan Sarkar Bloody-Badboy

😪
Wake me up when we can travel again
View GitHub Profile
@Bloody-Badboy
Bloody-Badboy / ContentTypes.php
Last active January 30, 2018 15:22
A PHP Class to get content type from file extension
<?php
/**
* Copyright (C) 2015 BloodyBadboyCreation, Inc. (Arpan Bloody Badboy)
*
* 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
*
@Bloody-Badboy
Bloody-Badboy / function_pointer.c
Created March 10, 2018 15:13
C Function Pointer Example
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef struct _user_ User;
struct _user_ {
char *first_name;
char *last_name;
char *email;
@Bloody-Badboy
Bloody-Badboy / Animators.kt
Created June 27, 2018 09:28 — forked from chrisbanes/Animators.kt
Material Image Loading treatment for Android
/*
* Copyright 2018 Google, Inc.
*
* 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
@Bloody-Badboy
Bloody-Badboy / hsl2rgb_rgb2hsl.c
Last active July 4, 2018 03:57
Conversion algorithms for converting HSL to RGB and RGB to HSL vice versa in C
#include <stdio.h>
static void hueToRgb(unsigned int *c, float p, float q, float t) {
if (t < 0.0f)
t += 1.0f;
if (t > 1.0f)
t -= 1.0f;
if (t < 0.166666)
*c = (unsigned int) ((q + (p - q) * 6 * t) * 100);
else if (t < 0.5)
@Bloody-Badboy
Bloody-Badboy / dictionary.txt
Created August 7, 2018 04:27
java keywords dictionary for proguard
syNCHRoNizeD
SynChronIzeD
InsTANceOF
synCHrOnIzeD
PRotEctEd
synchrONIzeD
insTanCEoF
sYNcHrOnizeD
IMpLEmENTS
SYnChROnIZeD
# Enable Gradle Daemon
org.gradle.daemon=true
# Enable Configure on demand
org.gradle.configureondemand=true
# Enable parallel builds
org.gradle.parallel=true
# Enable Build Cache
@Bloody-Badboy
Bloody-Badboy / ShowbizView.kt
Created December 14, 2018 17:02 — forked from nickbutcher/ShowbizView.kt
A prototype of an animation I helped out on, see: https://twitter.com/crafty/status/1073612862139064332
/*
* Copyright 2018 Google Inc.
*
* 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 distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@Bloody-Badboy
Bloody-Badboy / Log.java
Created December 21, 2018 16:15
Logging utility for java
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Created by bloodybadboycreation on 17/9/17.
*/

To remove OpenJDK (the one you've already installed)

sudo apt-get purge openjdk-\*

Make a new directory for your new JDK

sudo mkdir -p /usr/local/java

Copy the file to the directory (you should be in that file path)

sudo cp -r jdk-XuXX-linux-x64.tar.gz /usr/local/java/

Extract the file

@Bloody-Badboy
Bloody-Badboy / RingOfCirclesView.kt
Created March 4, 2019 05:18 — forked from alexjlockwood/RingOfCirclesView.kt
Kotlin implementation of a Ring of Circles animation, inspired by https://twitter.com/InfinityLoopGIF/status/1101584983259533312
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
private const val N = 16
private const val PERIOD1 = -10000.0
private const val PERIOD2 = -500.0