Skip to content

Instantly share code, notes, and snippets.

@justengel
justengel / office_to_html.py
Last active April 23, 2023 19:15
Convert Microsoft Office documents to html or pdf files that can be viewed in a web browser.
"""Convert office document to file formats that may be visible in a web browser. This file uses microsoft office to
convert the files, so Windows OS is assumed and required!
Requirements:
* pywin32>=228 # Not available for Python3.8 at this time
Server Requirements:
* uvicorn>=0.11.5
* fastapi>=0.58.0
* python-multipart>=0.0.5
@vijaywm
vijaywm / frappe-reference-guide.md
Last active March 25, 2024 10:24
Frappe Reference Guide
@zzpmaster
zzpmaster / formatBytes.dart
Last active February 8, 2024 18:51
convert bytes to kb mb in dart
static String formatBytes(int bytes, int decimals) {
if (bytes <= 0) return "0 B";
const suffixes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
var i = (log(bytes) / log(1024)).floor();
return ((bytes / pow(1024, i)).toStringAsFixed(decimals)) +
' ' +
suffixes[i];
}
@lorey
lorey / markdown_to_text.py
Last active April 8, 2024 03:25
Markdown to Plaintext in Python
from bs4 import BeautifulSoup
from markdown import markdown
import re
def markdown_to_text(markdown_string):
""" Converts a markdown string to plaintext """
# md -> html -> text since BeautifulSoup can extract text cleanly
html = markdown(markdown_string)
@seanbehan
seanbehan / app.py
Last active March 13, 2023 04:55
Flask with Django ORM
'''
Run the following commands (bc. gists don't allow directories)
pip install flask django dj-database-url psycopg2
mkdir -p app/migrations
touch app/__init__.py app/migrations/__init__.py
mv models.py app/
python manage.py makemigrations
python manage.py migrate
@mauri870
mauri870 / manjaro-avell-g1513.md
Last active March 2, 2022 02:23
Installation of Manjaro 17 and nvidia/bumblebee drivers on Avell G1513

After a weekend of research, stress and pain I finally figure out how to install manjaro 17 and configure the nvidia/bumblebee drivers on my avell laptop

Here's my notebook specs:

$ inxi -MGCNA

Machine:   Device: laptop System: Avell High Performance product: 1513
           Mobo: N/A model: N/A v: 0.1 UEFI: American Megatrends v: N.1.02 date: 09/28/2016
Battery    BAT0: charge: 44.0 Wh 100.0% condition: 44.0/44.0 Wh (100%)
// https://raw.githubusercontent.com/donnut/typescript-ramda/master/ramda.d.ts
// https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/lodash/lodash.d.ts
declare namespace fp {
interface Dictionary<T> {
[index: string]: T;
}
interface CurriedFunction1<T1, R> {
@jondaiello
jondaiello / _arrows.scss
Last active February 22, 2024 15:18
SASS @mixin for Arrows
// Demo at http://codepen.io/jondaiello/full/YWRbOx/
/* This mixin is for generating CSS arrows on a box */
@mixin box-arrow($arrowDirection, $arrowColor, $arrowSize: 10px) {
position: relative;
z-index: 10;
&::after {
content: '';
width: 0;
height: 0;
import express from 'express';
const app = express();
if (IS_DEV) {
require('piping')();
}
//express routes, etc.
export default app;
@markerikson
markerikson / appEntryPoint.js
Last active August 1, 2022 07:41
Webpack React/Redux Hot Module Reloading (HMR) example
import React from "react";
import ReactDOM from "react-dom";
import configureStore from "./store/configureStore";
const store = configureStore();
const rootEl = document.getElementById("root");