Skip to content

Instantly share code, notes, and snippets.

View daveamato's full-sized avatar
🎩
Keeping it classy

Dave Amato daveamato

🎩
Keeping it classy
View GitHub Profile

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple

OpenWRT Notes

opkg update
opkg install bash
opkg install adblock

USB Mount and fstab

opkg install kmod-fs-ext4 kmod-usb-storage usbutils mount-utils kmod-usb-storage-extras block-mount kmod-scsi-core e2fsprogs fdisk swap-utils
fdisk -l

VirtualBox Headless Ubuntu/Mint with phpVirtualBox

I had a lot of trouble setting this up, the guides out there don't seem complete. I used various guides and troubleshooting sites to get all of this figured out.

NOTE: My server's internal IP address is 10.10.10.100, you will need to substitute yours where appropriate.

Software Versions Used

  • Server Side
import subprocess
from threading import Thread
from time import time
from typing import Union
from queue import Queue
class SubprocessInputStreamer:
_end_of_stream = object()
<script>
jQuery( document ).ready( function() {
/* Form ID #5 */
var formID = 5;
var category = 'Email List';
var action = 'Subscribed';
var label = 'New Subscriber';
jQuery( document ).on('click', '.nf-form-' + formID + '-cont input[type=button]', function() {
ga('send', 'event', category, action, label );

Entity Framework Code First to an Existing Database

Source

This video and step-by-step walk-through provide an introduction to Code First development targeting an existing database. Code First allows you to define your model using C# or VB.Net classes. Optionally additional configuration can be performed using attributes on your classes and properties or by using a fluent API.

See the video that accompanies this step-by-step walkthrough.

Pre-Requisites

@daveamato
daveamato / ScrapingExample.py
Created March 4, 2015 19:05
ScrapingExample.py
import ui
import requests
import clipboard
from console import hud_alert
from bs4 import BeautifulSoup
def start_scrape(sender):
v = sender.superview
#hud_alert('enter a valid URL')
surl = v['surl'].text
/// <summary> Fast file move with big buffers
/// </summary>
/// <param name="source">Source file path</param>
/// <param name="destination">Destination file path</param>
static void FMove (string source, string destination)
{
int array_length = (int) Math.Pow (2, 20);
byte[] dataArray = new byte[array_length];
FileStream fsread = new FileStream (source, FileMode.Open, FileAccess.Read, FileShare.None, array_length * 2);