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
@aembleton
aembleton / Ignore certificate for HttpURLConnection in Android.java
Created March 27, 2011 17:25
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;
}
@bichotll
bichotll / load_disqus_comments_android.java
Last active April 25, 2019 15:19
Load disqus comments with a htmlview in Android
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_comments);
String htmlComments = getHtmlComment("yourId", "yourShortName");
webDisqus = (WebView) findViewById(R.id.disqus);
// set up disqus
WebSettings webSettings2 = webDisqus.getSettings();
@chrisbanes
chrisbanes / ForegroundLinearLayout.java
Created February 19, 2014 13:16
ForegroundLinearLayout
/*
* Copyright (C) 2006 The Android Open Source Project
*
* 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
@sareiodata
sareiodata / empty-wp-plugin.php
Created July 2, 2014 08:45
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
*/
@kabouzeid
kabouzeid / InternalStorageUtil.java
Created June 22, 2015 10:28
A simple helper class for Android to read and write any serializeable object to the internal storage
package com.kabouzeid.gramophone.util;
import android.content.Context;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@ygotthilf
ygotthilf / jwtRS256.sh
Last active April 17, 2024 04:10
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -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
@RyanRamchandar
RyanRamchandar / Example.java
Last active November 9, 2022 17:27
Cancel a running or queued Call with OkHttp3
// ...
Request request = new Request.Builder()
.url(url)
.tag(TAG)
.build();
// Cancel previous call(s) if they are running or queued
OkHttpUtils.cancelCallWithTag(client, TAG);
// New call
@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
@ziadoz
ziadoz / install.sh
Last active April 20, 2024 10:18
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`