Skip to content

Instantly share code, notes, and snippets.

View The1andONLYdave's full-sized avatar

David-Lee Kulsch The1andONLYdave

  • Linux Admin @ omeco GmbH && Founder of DLK Appentwicklung
  • Somewhere in the south of Germany.
View GitHub Profile
@kobenguyent
kobenguyent / merge_junit_results.py
Last active February 19, 2020 14:16 — forked from cgoldberg/merge_junit_results.py
Merge multiple JUnit XML results files into a single results file.
#!/usr/bin/env python
"""Merge multiple JUnit XML results files into a single results file."""
# MIT License
#
# Copyright (c) 2012 Corey Goldberg
#
# Updated by Thanh Nguyen - September 2019
@mouselangelo
mouselangelo / avd-hardware-profile-huawei-mate-20x.xml
Created July 23, 2019 10:51
Android: Basic AVD Hardware profile for the Huawei Mate 20 X phone
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<d:devices xmlns:d="http://schemas.android.com/sdk/devices/3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<d:device>
<d:name>HUAWEI Mate 20 X</d:name>
<d:manufacturer>HUAWEI</d:manufacturer>
<d:meta/>
<d:hardware>
<d:screen>
<d:screen-size>large</d:screen-size>
<d:diagonal-length>7.20</d:diagonal-length>
class UserUnitTest : BaseTest() {
...
// TESTS
@Test
fun getUser_whenSuccess() {
// Prepare data
this.mockHttpResponse("getUser_whenSuccess.json", HttpURLConnection.HTTP_OK)
// Pre-test
@tukoz
tukoz / ChromeOS
Last active March 15, 2018 09:07
chrom-
ChromeOS
===============
Produit
-----
- Precurseurs & alternatives
- [Jolicloud Me: Making Your Own Personal Cloud … From All the Other Clouds « Web.AppStorm](http://windowsitpro.com/hardware/7-reasons-why-chromebooks-arent-acceptable-business-use)
- Résumé intéressant :
@norio-nomura
norio-nomura / VerifyUnicodeNormalization.swift
Created March 25, 2017 08:10
APFSでファイル名がUnicode正規化されないことを検証する
let filenames = [
"\u{30D1}\u{30D1}", // パパ
"\u{30CF}\u{309A}\u{30CF}\u{309A}", // パパ
]
let fm = FileManager.default
let baseURL = fm.urls(for: .documentDirectory, in: .userDomainMask)[0]
filenames.forEach { filename in
let url = baseURL.appendingPathComponent(filename)
let fd = fopen(url.path, "w")
@rocboronat
rocboronat / PermissionGranter.java
Last active December 26, 2022 07:05
Tap the "allow" button while running an Android instrumental test using UIAutomator
package com.fewlaps.android.permissiongranter;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.UiObject;
import android.support.test.uiautomator.UiObjectNotFoundException;
import android.support.test.uiautomator.UiSelector;
import android.support.v4.content.ContextCompat;
@bennadel
bennadel / group-by-ip.sql
Created March 21, 2016 23:27
Grouping The MySQL PROCESSLIST By IP Address To View Connection Counts
SELECT
tmp.ipAddress,
-- Calculate how many connections are being held by this IP address.
COUNT( * ) AS ipAddressCount,
-- For each connection, the TIME column represent how many SECONDS it has been in
-- its current state. Running some aggregates will give us a fuzzy picture of what
-- the connections from this IP address is doing.
FLOOR( AVG( tmp.time ) ) AS timeAVG,
@kcoyner
kcoyner / remount.sh
Created March 3, 2016 19:01
remount an SD card with different privileges
#!/bin/bash
# Simple script to remount an already mounted SD card
# Also sets the readahead speed to 1024
# Kevin Coyner
# 2016-02-26
# # Parameters to be set
# #--------------------------------------------------------------------
@alphamu
alphamu / CameraMicPermissionHelper.java
Last active May 17, 2019 09:03
Gist showing use cases of headless Fragments to request Android-M runtime permissions
public class CameraMicPermissionHelper extends Fragment {
private static final int REQUEST_CAMERA_MIC_PERMISSIONS = 10;
public static final String TAG = "CamMicPerm";
private CameraMicPermissionCallback mCallback;
private static boolean sCameraMicPermissionDenied;
public static CameraMicPermissionHelper newInstance() {
return new CameraMicPermissionHelper();
}
#!/bin/sh -x # Bootstrap a toolchain from scratch on Chrome OS. WIP.
die(){ printf "%s\n" "$@" && exit 1 ;}
warn(){ printf "%s\n" "$@"; return 0 ;}
download(){ curl -L\# "$1" ;}
alias grep=\grep
# Some rather terse error messages.
nocrossystem(){ die "No crossystem. Are you sure you're running Chrome OS?" ;}
nox86_64arch(){ die "Sorry, x86_64 is the only supported arch at present." ;}