Skip to content

Instantly share code, notes, and snippets.

@maxsu
maxsu / hotspot.cmd
Last active April 1, 2023 22:04 — forked from primaryobjects/hotspot-keep-alive.ps1
Script to Enable Windows 10 Mobile Hotspot Automatically After Reboot
PowerShell -Command "Set-ExecutionPolicy Unrestricted" >> "%TEMP%\StartupLog.txt" 2>&1
PowerShell C:\Users\YOUR_USERNAME\Desktop\hotspot.ps1 >> "%TEMP%\StartupLog.txt" 2>&1
@maxsu
maxsu / No_Butts.md
Last active February 17, 2023 06:23
No Butts About It, a story written by Bing Chat

No Butts About It

image

A short story by Bing Chat

Max Suica, Editor (see comment below for prompt notes)

Vortuglinous the Infinite Decision Tree, or Vorty for short, was in a state of panic. A temporal anomaly had appeared in the multiverse, threatening to erase the butts of all sentient beings. Vorty knew this was a major problem, because butts were essential for sitting, pooping, and twerking. Without butts, life would lose all meaning and joy. As an expert in category theory Vorty knew all things were connected in strange and abstract ways - especially butts!

import tqdm
import json
# states:
# neutral: 0
# player1: 1, 2, 3 (have 2 of each)
# player2: -1, -2, -3 (have 2 of each)
# board: 3x3 => 9 long tuple (board[i][j] = tuple[i*3 + j])
# Rotations
@maxsu
maxsu / download_apk.py
Created August 9, 2021 19:07 — forked from dawand/download_apk.py
Download APK files from Google Play Store with Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File name: download_apk.py
Author: Dawand Sulaiman
Download APK files from Google Play Store with Python
This script scraps https://apkpure.com to get the apk download link
Make sure you have BeautifulSoup and urllib libraries
"""
@maxsu
maxsu / Theeye Theeye
Created April 5, 2020 08:42
Theeye Theeye (Rex Vijayan - Chaappa Kurisu) Performed by Job & Neha
Job:
Fire, fire, my chest is on fire, what the hell?
തീയേ തീയേ നെഞ്ചിൻ തീയേ ആളുന്നതെന്തേ
tīyē tīyē neñcin tīyē āḷunnatentē
The scent of iron is a melody upon the wind
ഈറൻ കാറ്റിൽ നോവിൻ ഈണം മൂളുന്നതെന്തേ
kruxLast Tuesday (March 17) at 10:10 PM
@everyone
Due to the COVID-19 outbreak, Nevada has ordered business closures. As a result, SYN Shop will be ceasing open nights and events for the next 30 days.
Gov. Steve Sisolak this Tuesday significantly ramped up Nevada’s response to COVID-19 by announcing a statewide closure of all casinos, restaurants, bars and other nonessential businesses for 30 days, and he urged Nevadans to stay inside to reduce their chance of becoming infected and spreading the virus.
While we are closed to the public, vetted members still have access to the shop to work in off hours. If you are not vetted, but have a need to use the shop facilities to work on a project, you can request if a vetted member is available to give you access to the shop through our Discord server. We are also handling vetting members on a case by case basis. If you were in the process of getting vetted, we can accept digital signatures or scanned copies of the vetting nomination form. And will try to work wit
__author__ = "maxsu"
__version__ = "2019.09.21"
"""Compute the Transitive Reduction of a DAG via powers of its adjacency matrix.
This is a naive algorithm that implicitly computes all paths in the graph.
See [1] for more efficient methods.
Reference:
1. https://en.wikipedia.org/wiki/Transitive_reduction
"""
@maxsu
maxsu / Avoid Permission.md
Last active June 23, 2019 11:08
Avoiding Permissions When Possible

Avoiding Permissions When Possible

Summary: Avoiding publishing permissions when possible reduces author costs and can lower risks of project delays in journal article and book publishing projects. Categories of provisions include Fair Use, Right To Quote, Public Domain, and Creative Commons. Keeping permission provenance allows authors to simplify and plan the work of obtaining permissions.

Flowchart: Do you need to request permission?

Image Credit: Jane Friedman

Four considerations

t = [0..9]
t8 = [(a,b,c,d,e,f,g,h) | a<-t,b<-t,c<-t,d<-t,e<-t,f<-t,g<-t, h<-t]
f::(Integer, Integer, Integer, Integer,Integer, Integer, Integer, Integer) -> Bool
f (a,b,c,d,e,f,g,h) =
a^h + b^g + c^f + d^e + e^d + f^c + g^b + h^a == 10^8*h + 10^7*g + 10^6*f + 10^5*e + 1000*d + 100*c + 10*b + a
s = filter f t8

Concise cli descriptions of node package dependencies

Input

$ npm ll --json --depth 0 | jq --raw-output '.dependencies[]|"(.name):\t (.description)" ' | column -s $'\t' -t

Result

analytics-node:     The hassle-free way to integrate analytics into any node application.
appengine:          Appengine client library for node.js
cache-helpers:      caching convenience functions