This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| https://github.com/datalog/datamatrix-svg | |
| under MIT license | |
| # datamatrix.js has no dependencies | |
| Copyright (c) 2020 Constantine | |
| */ | |
| function DATAMatrix(Q) { | |
| var M = [], | |
| xx = 0, | |
| yy = 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # License MIT | |
| # Author Jake Duncan. | |
| # [email protected] | |
| # copyright 2023 | |
| from typing import Any, Generic, Type, TypeVar | |
| from engine import Session, engine | |
| from models import Base |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useLocation, useSearchParams } from "react-router-dom" | |
| import { useCallback, useEffect, useState } from "react" | |
| /** | |
| * This hook will watch and return the value of a query param. If the defaultValue is provided, | |
| * it will be set if the query param is not found. | |
| * @param key The query param to get | |
| * @param defaultValue A value to set if the query param is not found | |
| */ | |
| export const useQueryParam = <T extends string = string>(key: string, defaultValue?: string): [T, (s: T) => void] => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # endwise - auto closes ruby ends | |
| mkdir -p ~/.vim/bundle | |
| git clone git://github.com/tpope/vim-endwise.git ~/.vim/bundle | |
| # ctrlp - Fuzzy search via ctrl + p | |
| mkdir -p ~/.vim/bundle | |
| git clone https://github.com/kien/ctrlp.vim.git bundle/ctrlp.vim ~/.vim/bundle | |
| # nerdtree - tree display for current directory in vim | |
| mkdir -p ~/.vim/bundle | |
| git clone https://github.com/preservim/nerdtree.git ~/.vim/bundle | |
| # supertab - all your auto completion for insert mode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Use Vim settings, rather then Vi settings (much better!). | |
| " This must be first, because it changes other options as a side effect. | |
| set nocompatible | |
| " source ~/.vimrc.before if it exists. | |
| if filereadable(expand("~/.vimrc.before")) | |
| source ~/.vimrc.before | |
| endif | |
| " ================ General Config ==================== | |
| set number relativenumber "Line numbers are good | |
| set backspace=indent,eol,start "Allow backspace in insert mode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Memoized(object): | |
| """Decorator. Caches a function's return value each time it is called. | |
| If called later with the same arguments, the cached value is returned instead | |
| of running the function again. | |
| Note: This memoizer only works with functions that don't have keyword arguments. | |
| This particular implementation of the class uses a single cache instance for | |
| all cached functions. It uses the singleton pattern to accomplish this. The advantages | |
| of this implementation is that we have control of the caches for each function in | |
| the main *Memoized* class. This allows us to clear or reset the caches for all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| from app import app | |
| def main(): | |
| parser = argparse.ArgumentParser( | |
| description='Sanic test server', | |
| formatter_class=argparse.ArgumentDefaultsHelpFormatter | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Created by bigjaked392 on 2016-09-28 | |
| # based partially on gist found here https://gist.github.com/cbednarski/3ada27b2c401cc163dc4 | |
| # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, | |
| # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY | |
| # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
| # REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Useful for students in need of block quotes for their paper, etc. | |
| // Execute the line in your JavaScript console | |
| new_window=window.open();new_window.document.body.innerHTML = $('iframe').contents().find('iframe').contents().find('body').get(1).innerHTML; | |
| javascript:new_window=window.open();new_window.document.body.innerHTML = $('iframe').contents().find('iframe').contents().find('body').get(1).innerHTML; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import socket | |
| from OpenSSL import crypto, SSL | |
| # OpenVPN is fairly simple since it works on OpenSSL. The OpenVPN server contains | |
| # a root certificate authority that can sign sub-certificates. The certificates | |
| # have very little or no information on who they belong to besides a filename | |
| # and any required information. Everything else is omitted or blank. | |
| # The client certificate and private key are inserted into the .ovpn file | |
| # which contains some settins as well and the entire thing is then ready for |