Skip to content

Instantly share code, notes, and snippets.

package com.geekorum.geekdroid.navigation
import android.content.Context
import android.os.Bundle
import android.util.AttributeSet
import androidx.core.content.res.use
import androidx.core.os.bundleOf
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
@fishi0x01
fishi0x01 / baseURL.groovy
Last active February 3, 2025 16:37
This is a collection of groovy scripts I gathered and use for bootstrapping Jenkins. Most of this can also be achieved with the CasC Plugin https://github.com/jenkinsci/configuration-as-code-plugin
#!groovy
/*
* This script configures the Jenkins base URL.
*/
import jenkins.model.JenkinsLocationConfiguration
JenkinsLocationConfiguration location = Jenkins.instance.getExtensionList('jenkins.model.JenkinsLocationConfiguration')[0]
location.url = 'https://jenkins-as-code-poc.devtail.io/'
@pkozlovskiy
pkozlovskiy / VideoEnabledWebChromeClient.java
Created October 5, 2016 12:26 — forked from benvium/VideoEnabledWebChromeClient.java
Playing HTML5 video on fullscreen in android webview. Note: I did not write this, it has been taken from http://stackoverflow.com/questions/15768837/playing-html5-video-on-fullscreen-in-android-webview
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebChromeClient;
import android.widget.FrameLayout;
import android.widget.VideoView;
@danielgomezrico
danielgomezrico / build.gradle
Last active September 5, 2016 11:44
Gradle / Android tasks to run findbugs and pmd static code checkers after assembleDebug. thanks to https://gist.github.com/rciovati/8461832
// How to use it inside any gradle build
apply from: "quality.gradle"
@vmlinz
vmlinz / build_strongswan_android.md
Last active March 6, 2021 07:31
Instructions to build StrongSwan android client from git source

Instructons of building StrongSwan android client from git source

Official guide

https://wiki.strongswan.org/projects/strongswan/wiki/AndroidVPNClientBuild

  • Preparing the dev environment(Build on Ubuntu 14.04 amd64 to prevent various issues), see the [Doc] [1]
  • Preparing the source code: ./autogen.sh && ./configure && make dist
  • Preparing the dev environment with Android sdk and ndk for further development
@kennwhite
kennwhite / vpn_psk_bingo.md
Last active April 5, 2025 04:55
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@aluminiumgeek
aluminiumgeek / Vagrantfile
Last active June 1, 2017 11:43
Key auth for Vagrant VMs
require_relative '../vagrant/key_authorization'
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/trusty64'
authorize_key_for_root config, '/home/mihail/.ssh/id_dsa.pub', '/home/mihail/.ssh/id_rsa.pub'
{
'db' => '192.168.33.10',
'elasticsearch'=> '192.168.33.11',
'app' => '192.168.33.12'
}.each do |short_name, ip|
@JakeWharton
JakeWharton / AutoGson.java
Last active January 1, 2025 22:35
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
@ericbmerritt
ericbmerritt / git-semver.sh
Created July 30, 2014 21:04
Shell script for parsing semvers from git-describe
#! /bin/bash
# Assumes that you tag versions with the version number (e.g., "1.1")
# and then the build number is that plus the number of commits since
# the tag (e.g., "1.1.17")
DESCRIBE=`git describe --tags --always`
# increment the build number (ie 115 to 116)
VERSION=`echo $DESCRIBE | awk '{split($0,a,"-"); print a[1]}'`
@cmelchior
cmelchior / AndroidManifest.xml
Last active December 25, 2015 13:59
Adding support for ".res-auto" in ContentProvider authorities in AndroidManifest.xml. This replaces ".res-auto" with the current package name, making it possible to install multiple build variants on the same devices without getting [INSTALL_FAILED_CONFLICTING_PROVIDER]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.trifork.example"
android:installLocation="auto"
android:versionName="@string/client_info" >
<!-- ... -->
<application
android:hardwareAccelerated="true"