Skip to content

Instantly share code, notes, and snippets.

@maxsu
maxsu / Circle Packing Script
Created July 17, 2015 06:57
A circle packing script in rhinoscript, for rhino 3d 4.0 only.
Option Explicit
'Script written by Steven Janssen
'Script copyrighted by Steven Janssen
'Script version Sunday, 18 May 2008 11:34:18 AM
Call Main()
Sub Main()
Dim arrPoint(), arrRadius(), intCircleNumber, arrInputR, arrSide(2)
Dim strCurrentCircleID, R, intCurrentCentre, k
Dim dblCosA, dblRotA

Here's a prettty rough synopsis. Check this for a better intro with some simple background in cryptography: http://www.pgpi.org/doc/pgpintro/

The steps are not entirely easy (which is why I want to practice them).

  1. Get an implementation of PGP. GPG4Win works in windows, while a more secure approach is to make a dedicated Tails USB key and boot into the Tails OS whenever you want to use PGP.
  2. Generate a public key and a private key, and a public key fingerprint
  3. Send the public key to a friend
  4. Call that friend and read them the public key fingerprint
  5. That friend verifies the public key using the fingerprint and they own copy of PGP

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
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
@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

__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
"""
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
@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
ഈറൻ കാറ്റിൽ നോവിൻ ഈണം മൂളുന്നതെന്തേ
@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
"""
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