Skip to content

Instantly share code, notes, and snippets.

import asyncio
import requests
import time
import os
import sys
from bleak import discover, BleakError
BLUE_RADIOS_CID = 133
STATIC_DATA_TID = 0x3C
TEMPERATURE_DATA_STRUCTURE_ID = 0x43
@nehalvpatel
nehalvpatel / mindtap_cards.py
Created March 20, 2018 18:58
Rudimentary script to parse and format MindTap flashcards for Quizlet
import json, re, sys
from bs4 import BeautifulSoup
input_file = sys.argv[1]
with open(input_file, encoding="utf8") as json_handle:
data = json.load(json_handle)
for card in data[0]:
@nehalvpatel
nehalvpatel / gist:be79e812d21825326886
Created August 20, 2015 23:34
Fixed apache script for Vaprobash (removed apache2-mpm-event)
#!/usr/bin/env bash
# Test if PHP is installed
php -v > /dev/null 2>&1
PHP_IS_INSTALLED=$?
# Test if HHVM is installed
hhvm --version > /dev/null 2>&1
HHVM_IS_INSTALLED=$?
@nehalvpatel
nehalvpatel / gist:766406821e8f393c7743
Created May 3, 2015 22:28
Proper permissions for /var/www
sudo adduser <username> www-data
sudo chgrp -R www-data /var/www
sudo chmod -R g+rw /var/www
find /var/www -type d -print0 | sudo xargs -0 chmod g+s