Skip to content

Instantly share code, notes, and snippets.

@CyrilNb
CyrilNb / CustomWebView.txt
Last active September 16, 2021 19:06
[Android] webview permission camera + file picker
class MoonPayPaymentWebView : AppCompatActivity() {
companion object {
const val PERMISSION_REQUEST_CODE = 1000
const val REQUEST_SELECT_FILE = 1001
private const val FILECHOOSER_RESULTCODE = 1002
private var mUploadMessage: ValueCallback<Uri?>? = null
var uploadMessage: ValueCallback<Array<Uri>>? = null
}
@polyjitter
polyjitter / custom.css
Last active August 22, 2020 12:39 — forked from donysukardi/custom.css
Rounded VS Code Tabs
.monaco-workbench>.part.editor>.content>.one-editor-silo>.container>.title .tabs-container {
padding-left: 22px;
}
.monaco-workbench>.part.editor>.content>.one-editor-silo>.container>.title .tabs-container>.tab {
border-radius: 5px 5px 0 0;
height: 28px;
}
.monaco-workbench>.part.editor>.content>.one-editor-silo>.container>.title .tabs-container>.tab + .tab {
@mksantoki
mksantoki / MainActivity.java
Created October 31, 2017 17:52
FileChooser in Android webview
/*
reference link ->https://www.opengeeks.me/2015/08/filechooser-and-android-webview/
https://github.com/OpenGeeksMe/Android-File-Chooser
*/
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
@amishshah
amishshah / har-extract.js
Created February 12, 2017 16:14
Rough script to extract images from HTTP Archive (HAR) files
const fs = require('fs');
const file = JSON.parse(fs.readFileSync('./dump.har')).log;
const targetMimeType = 'image/jpeg';
let count = 1;
for (const entry of file.entries) {
if (entry.response.content.mimeType === targetMimeType) {
// ensure output directory exists before running!
fs.writeFileSync(`output/${count}.png`, new Buffer(entry.response.content.text, 'base64'), 'binary');
count++;
@inexorabletash
inexorabletash / @ Indexed DB - N-Dimensional Select.md
Last active April 16, 2024 20:38
Indexed DB - N-dimensional selection

Indexed DB - N-Dimensional Selection

The problem

We have an index with keys of the form:

[ dim1, dim2, dim3, ... ]

e.g. created with:

@brattonc
brattonc / README.md
Last active November 20, 2023 17:14
D3 Liquid Fill Gauge

Liquid Fill Gauge v1.1 - 7/14/2015

Changes:

  • Added support for updating the gauge value after loading is complete. The loadLiquidFillGauge method now returns an object with an update method which allows the gauge value to be changed. Click any of the gauges above to randomly update their value.

Configurable features include:

  • Changeable min/max values.
  • All colors.
@danielpquinn
danielpquinn / svg-rounded-rectangle-path.js
Last active April 20, 2024 13:04
Draw SVG Rounded Rectangle Path
/**
* Get path data for a rounded rectangle. Allows for different radius on each corner.
* @param {Number} w Width of rounded rectangle
* @param {Number} h Height of rounded rectangle
* @param {Number} tlr Top left corner radius
* @param {Number} trr Top right corner radius
* @param {Number} brr Bottom right corner radius
* @param {Number} blr Bottom left corner radius
* @return {String} Rounded rectangle SVG path data
*/
@gertig
gertig / Mac style drop shadow.css
Created August 23, 2012 20:38
Mac style drop shadow
box-shadow:inset 0 1px 0 rgba(255,255,255,.6), 0 22px 70px 4px rgba(0,0,0,0.56), 0 0 0 1px rgba(0, 0, 0, 0.3);