Skip to content

Instantly share code, notes, and snippets.

@aaronyoo
aaronyoo / setup_ctfd.py
Created April 7, 2019 01:27
Python script to do some setup operations on CTFd
import requests
import re
def main():
print("starting")
# Set the admin cookie before doing anything else
my_cookie = {
"name":"admin",
"value":"true"
@tzmartin
tzmartin / embedded-file-viewer.md
Last active July 1, 2024 01:57
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

/** Fixed point combinator: The essence of recursion */
def fix[T, R](f: (T => R) => (T => R)): (T => R) = new Function1[T, R] {
def apply(t: T): R = f(this)(t)
}
/** Factorial definition with fixed point */
def factorial(recursive: Long => Long) = (x: Long) => x match {
case 1 => 1
case x => x * recursive(x-1)
}