Skip to content

Instantly share code, notes, and snippets.

@williamhaley
williamhaley / MITAppInventorModernEmulators.md
Created February 25, 2021 14:58
MIT App Inventor with Modern Android Emulators

MIT App Inventor is a great way to explore mobile application development for Android without needing to know how to code in Java or Kotlin. This is often referred to as "no-code" or "WYSIWYG" (what you see is what you get) programming.

The App Inventor uses Scratch blocks and a visual designer (not so dissimilar from Xcode's UI) to program the app.

However, the emulators provided by MIT aren't necessarily modern or full featured. There is a way around this though.

Export An APK

After building your app in MIT App Inventory, click Build -> App ( save .apk to my computer ) to download an .apk build of the app.

@williamhaley
williamhaley / alice_in_wonderland.encrypted.txt
Last active January 20, 2021 20:48
Alice in Wonderland encrypted with gpg AES256 and "password" as the password
 �
-g��*z������{����ar� ս�P���{-f���@���ZD
_����_�slˍ��f����l.��e�fӺTm�W��#E�|�c�e���W�GՐ�n� �y� RE3ۉI�6ҍVU5���o�ÿ,���&��n�"��T���C#��&FĠ��oJ����' p>z�aM�U�X�~�蠹�4��-7#w��WEI��?}n�@G&ٰ����O&�;
� ��4/���h��F���P�j��v\9�ގ�
G�#k2�(Qd��#�D|��a�<�t�KlO�.B*
m�R�cEx%$@�
z�u]��@`YD<f[ã0��i�(�(:5�Kzh�ݽ�$;YR�›��9,~�=w� ���Y�Z�W�_�]��`�R�\ĿQ
2�*҄�o���h���b0?� �cuZlz�ֵ�0W�~h)����;��'���)[h()��rاP�Cp@'?ZI��I�Q���/�u�]��!b��0n^��2�h�r"��=?��o���+�{�.¿�|��0��Z>d���'�Ob��-xrϒ�Uz;�ȏlo �B@�/1����M�ܞ^܄Z��T�f��IX��^z�B>�L�5�NWW�]���L�����f��B����T�I���Ks�U��>(C�Xy�!�G;3�螩蓾v;Bc�=g����l��Ѻ�$4�kZ~|�>ˇ0��.��V�.�/����{��cf��rCH��S/�I�F7I����V3�6G���Sڣ�&�YHd��7�B��qC��i��#!n2�����BK!v��V����#R>��N+W~%F�/��?K]!*�����/ �m{V%�0��16����*�i���D{A�NEX"�~�;��:�N��o��jm�(�*ރ~aF�}�a�ǚ�#�4hA 7�F��T��j���=�rE���DG���I��x��4�2���DlƄC?[ Qdc��<=�lF��Ā�t���:�e�8�N?L�n��a��\e
_˾�婰�2�ܑ�q_U:���
@williamhaley
williamhaley / README.md
Last active January 20, 2021 20:51
A demonstration of encryption vs hashing using the full English text of the book, Alice in Wonderland

Plain text / source material

Here is the plain text English full version of Alice in Wonderland.

Hashed

Here is a hash of the entire book. Every single word, punctation mark, space, etc.

c8f5de222fcf1804197e97b0df02d30d25ab70715fcf93bb8d61c0f7b2c13acb
@williamhaley
williamhaley / MoveLeftCommand.java
Created December 16, 2020 20:05
NCP Java Demo (Commands)
public class MoveLeftCommand extends RobotCommand {
public MoveLeftCommand(String button) {
super(button);
}
protected void logic() {
// Set up the motors
// Move the robot
// Make sure robot is in the right position
System.out.println("move left!");
@williamhaley
williamhaley / Main.java
Created December 16, 2020 20:04
NCP Java Demo (Logic)
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
class Main {
public static void main(String[] args) {
Demo demo = new Demo();
demo.doTheDemo();
@williamhaley
williamhaley / Client.java
Last active December 16, 2020 20:01
NCP Java Demo (Client and Server)
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
public class Client {
private Socket clientSocket;
private PrintWriter out;
private BufferedReader in;
@williamhaley
williamhaley / HelloWorld.java
Last active December 16, 2020 19:58
NCP Java Demo (Hello World)
class Main {
public static void main(String[] args) {
System.out.println("hello world");
}
}
@williamhaley
williamhaley / license-audit.js
Created January 24, 2020 01:42
Get the top-level licenses of all node packages/libraries/modules and print them out in CSV
/**
* Run this script from the root of the repo you want to inspect. It's assumed
* that there's a `./node_modules` and `./package.json` where this script runs.
*/
const packageJSON = require('./package.json');
// Get all the top-level dependencies for the current project.
const dependencies = {
...packageJSON.dependencies,
@williamhaley
williamhaley / nginx.sh
Created January 2, 2020 00:48
Generate LetsEncrypt cert and deploy nginx from docker with HTTP basic auth
#!/usr/bin/env bash
set -x
email='[email protected]'
domain='whatever.wherever.com'
username='admin'
password='password'
# Copy this inside the container. Let's Encrypt is going to modify it automatically.
@williamhaley
williamhaley / gcd.go
Created December 29, 2018 23:17
Calculate the Greatest Common Denominator using GoLang
package main
import (
"fmt"
)
// https://www.reddit.com/r/golang/comments/7b4mt9/greatest_common_divisor/
// GreatestCommonDenominator finds the GCD of two ints
func GreatestCommonDenominator(a, b int) int {