Skip to content

Instantly share code, notes, and snippets.

View raphaelbussa's full-sized avatar
💻
Working from anywhere

Raphaël Bussa raphaelbussa

💻
Working from anywhere
View GitHub Profile
<?php
$url_redirect= $_GET["url"];
header("Location: ".$url_redirect);
?>
@raphaelbussa
raphaelbussa / PreferenceList.xml
Last active August 29, 2015 14:09
List view for custom preference activity android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical" >
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
@raphaelbussa
raphaelbussa / YouTubeItem
Created May 31, 2015 20:39
A simple parser for new video from a YouTube user, remember add Jsoup (http://jsoup.org/) in your project for parse XML
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Raphael Bussa <raphaelbussa@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@raphaelbussa
raphaelbussa / redirect-oauth2.php
Created February 24, 2016 19:56
Oauth2 redirect url
<?php
header('Content-Type: application/json');
$response = array();
$code= $_GET["code"];
if ($code == "") {
$response["success"] = false;
} else {
$response["success"] = true;
$response["code"] = $code;
}
@raphaelbussa
raphaelbussa / ChromeCustomTabHelper.java
Last active May 6, 2016 11:31
A simple chrome custom tab helper, remeber to add compile 'com.android.support:customtabs:23.3.0' in your build.gradle
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Raphaël Bussa
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@raphaelbussa
raphaelbussa / PrintHelper.java
Last active May 3, 2016 08:57
Simple helper for print an url or an html
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Raphaël Bussa
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@raphaelbussa
raphaelbussa / CustomSnackbar.java
Last active October 30, 2018 12:01
Helper for inflate custom layout in google support design snackbar
/*
* The MIT License (MIT)
*
* Copyright (c) 2016 Raphaël Bussa
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@raphaelbussa
raphaelbussa / Ignore certificate for HttpURLConnection in Android.java
Created May 9, 2017 14:21 — forked from aembleton/Ignore certificate for HttpURLConnection in Android.java
The following code disables SSL certificate checking for any new instances of HttpsUrlConnection
/**
* Disables the SSL certificate checking for new instances of {@link HttpsURLConnection} This has been created to
* aid testing on a local box, not for use on production.
*/
private static void disableSSLCertificateChecking() {
TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@raphaelbussa
raphaelbussa / jwtRS256.sh
Created March 27, 2018 13:23 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@raphaelbussa
raphaelbussa / empty-wp-plugin.php
Created May 2, 2018 21:12 — forked from sareiodata/empty-wp-plugin.php
Empty WordPress plugin
<?php
/**
* Plugin Name: Name Of The Plugin
* Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
* Description: A brief description of the Plugin.
* Version: The Plugin's Version Number, e.g.: 1.0
* Author: Name Of The Plugin Author
* Author URI: http://URI_Of_The_Plugin_Author
* License: A "Slug" license name e.g. GPL2
*/