Skip to content

Instantly share code, notes, and snippets.

View ClaireSoftware's full-sized avatar
🎯
Focusing

Claire Chambers ClaireSoftware

🎯
Focusing
  • Clemson, SC
View GitHub Profile
@ClaireSoftware
ClaireSoftware / locationscrape.py
Created June 21, 2020 19:24
Scrape locations from pokemonDB
from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from bs4 import BeautifulSoup
import requests

What are alias files?

Alias files, in gmenux2 and gmenunx, are files that tell the file selector to replace one filename with another when displaying the ROM name. Originally meant for MAME and Neo-Geo ROMS, they're also useful for use with no-intro compatible ROM collections, allowing one to have intact filenames (retroarch coverart uses nointro filenames, for example) while still having human-readable game names.

Using alias files

To use an alias file, find your emulator core under /mnt/gmenu2x/sections/emulators/, and add a line to the config file aliasfile=/mnt/PATH_TO_INTRO_FILE. (if you're lame, you can also set it from the GUI).

Generating alias files

@ClaireSoftware
ClaireSoftware / aliasfiles.md
Created December 30, 2019 03:56
Generate gmenux2 alias files

What are alias files?

Alias files, in gmenux2 and gmenunx, are files that tell the file selector to replace one filename with another when displaying the ROM name. Originally meant for MAME and Neo-Geo ROMS, they're also useful for use with no-intro compatible ROM collections, allowing one to have intact filenames (retroarch coverart uses nointro filenames, for example) while still having human-readable game names.

Using alias files

To use an alias file, find your emulator core under /mnt/gmenu2x/sections/emulators/, and add a line to the config file aliasfile=/mnt/PATH_TO_INTRO_FILE. (if you're lame, you can also set it from the GUI).

Generating alias files

@ClaireSoftware
ClaireSoftware / dininghall.el
Last active October 7, 2019 21:26
script to get menu of schiletter dining hall
#!/bin/sh
":"; exec emacs --quick --script "$0" "$@" # -*- mode: emacs-lisp; lexical-binding: t; -*-
(defun schiletter-menu ()
(interactive)
(require 'dom)
(require 'cl)
;; url seems to have "period ID" for meals
;; breakfast is 891
;; lunch is 892
@ClaireSoftware
ClaireSoftware / gist.md
Created October 6, 2019 23:56
How to get time ranges with emacs lisp

How to get time ranges with emacs lisp

(defun time-in-range-p (lower time higher)
  (and (time-less-p lower time) (time-less-p time higher)))
(defun hm-to-time (hours minutes)
  (apply 'encode-time 0 minutes hours (subseq (decode-time) 3 6)))

Example code:

# How to get time ranges with emacs lisp
```lisp
(defun time-in-range-p (lower time higher)
(and (time-less-p lower time) (time-less-p time higher)))
(defun hm-to-time (hours minutes)
(apply 'encode-time 0 minutes hours (subseq (decode-time) 3 6)))
```
Example code:

Keybase proof

I hereby claim:

  • I am clairesoftware on github.
  • I am clairesoftware (https://keybase.io/clairesoftware) on keybase.
  • I have a public key ASCHEM8gTIdrozE9sNTJBfzp3j0QyhCv-JU2AUJeTaDGkQo

To claim this, I am signing this object:

@ClaireSoftware
ClaireSoftware / wndr3400.md
Last active March 30, 2019 15:50
WNDR3400v3 Authentication

The Netgear WNDR3400v3 uses a somewhat simple HTTPS basic authentication protocol for remote login requests (should be the same for local, but with HTTP), but checks for a session cookie (if the current session cookie is not still valid). To authenticate to the router, first send a request to the root of the router, save the cookies (this will 401), and then use said cookie to get whatever page you would like.

wget --keep-session-cookies --save-cookies cookies.txt -O cookies.html https:///ROUTER_IP:ROUTER_PORT --no-check-certificate \

(if that command doesn't give you a cookie, try using these headers, replacing YOUR_AUTH with a base64 ascii encoded string containing "YOUR_USERNAME:YOUR_PASSWORD")

{
    "Host": "YOUR_IP:YOUR_PORT",