Can be used for streaming data (webcam or screen capture) from the Windows to WSL
Run from a WSL terminal
ip route list default | awk '{print $3}'
package com.mygdx.game; | |
import com.badlogic.gdx.ApplicationAdapter; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.graphics.Color; | |
import com.badlogic.gdx.graphics.GL20; | |
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; | |
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; | |
public class MyGdxGame extends ApplicationAdapter { |
using UnityEngine; | |
using System.Collections; | |
using System.IO; | |
/* | |
Usage: | |
1. Attach this script to your chosen camera's game object. | |
2. Set that camera's Clear Flags field to Solid Color. | |
3. Use the inspector to set frameRate and framesToCapture |
<?php | |
it('extracts video ID from YouTube URLs', function ($url, $expectedId) { | |
expect(get_youtube_video_id($url))->toBe($expectedId); | |
})->with([ | |
['https://youtu.be/dQw4w9WgXcQ', 'dQw4w9WgXcQ'], | |
['https://www.youtube.com/watch?v=dQw4w9WgXcQ', 'dQw4w9WgXcQ'], | |
['http://youtube.com/v/dQw4w9WgXcQ', 'dQw4w9WgXcQ'], | |
['https://www.youtube.com/embed/dQw4w9WgXcQ', 'dQw4w9WgXcQ'], | |
['https://www.youtube.com/shorts/dQw4w9WgXcQ', 'dQw4w9WgXcQ'], |
// Since the WKWebView has no sizeToFit() method, increase the frame height of the webView to | |
// match the height of the content's scrollHeight | |
// | |
// The WKWebView's `navigationDelegate` property needs to be set for the delegate method to be called | |
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { | |
if webView.isLoading == false { | |
webView.evaluateJavaScript("document.body.scrollHeight", completionHandler: { [weak self] (result, error) in | |
if let height = result as? CGFloat { |
Can be used for streaming data (webcam or screen capture) from the Windows to WSL
Run from a WSL terminal
ip route list default | awk '{print $3}'
import os | |
import re | |
import sqlite3 | |
import zipfile | |
import numpy as np | |
import pandas as pd | |
import spacy | |
from ankipandas import Collection | |
from sklearn.feature_extraction.text import TfidfVectorizer |
It's a lot easier to test accessibility on the fly using ADB. This gist attempts to make the days of navigating through the Android device settings UI to change Accessibility settings obsolete.
These ADB commands will hopefully encourage Android developers to test and use their apps with common Accessiblility settings enabled.
Credit to James Nitsch for inspiring this, and for figuring out the put
commands to enable these settings.
// only covers a small subset of the Map api! | |
// haven't debugged yet! | |
class BigMap { | |
constructor(iterable) { | |
if(iterable) throw new Error("haven't implemented construction with iterable yet"); | |
this._maps = [new Map()]; | |
this._perMapSizeLimit = 14000000; | |
this.size = 0; | |
} |
<?php | |
/** | |
* Class Comments. | |
* Code refactored from: | |
* https://gist.github.com/mattclements/eab5ef656b2f946c4bfb | |
* | |
* @package Foo | |
*/ | |
namespace Boop; |