Skip to content

Instantly share code, notes, and snippets.

View mikewlange's full-sized avatar
💡
The dude abides

Mike Lange mikewlange

💡
The dude abides
View GitHub Profile
@mikewlange
mikewlange / Cliref.md
Created April 30, 2017 02:57 — forked from yunga/Cliref.md
CLIRef.md
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     yunga.palatino@gmail.com
 20160515 \/ 1527 \/         \/     \/

alias CLIRef.txt='curl -s "http://pastebin.com/raw/yGmGiDQX" | less -i'

@mikewlange
mikewlange / c# Private Field Access
Created May 16, 2017 19:55
This is how you access necessary private fields in closed source libraries without having to decompile and recode their spaghetti.
public static T GetPrField<T>(this object obj, string name)
{
BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic;
Type type = obj.GetType();
FieldInfo field = type.GetField(name, flags);
return (T)field.GetValue(obj);
}
@mikewlange
mikewlange / mlLinRegSlope
Created May 17, 2017 17:31
Lin Reg Slope w/ Exp Weighting
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "config/bitcoin-config.h"
#endif
#include "net.h"
@mikewlange
mikewlange / gist:9383ca28f12af019013f2c0f399103ea
Last active July 29, 2017 15:45
wget, curl, httrack crap
HTTRACK -- BEST
// BEST
sudo apt install httrack
httrack -w website.com
WGET
Download a web page with all assets – like stylesheets and inline images – that are required to properly display the web page offline.
wget ‐‐page-requisites ‐‐span-hosts ‐‐convert-links ‐‐adjust-extension https://www.couponcabin.com/coupons
@mikewlange
mikewlange / ass
Created May 25, 2017 06:49
best way download a full site
BEST WAY TO DOWNLOAD FULL WEBSITE WITH WGET
I show two ways, the first way is just one command that doesnt run in the background - the second one runs in the background and in a different "shell" so you can get out of your ssh session and it will continue either way
First make a folder to download the websites to and begin your downloading: (note if downloading www.kossboss.com, you will get a folder like this: /websitedl/www.kossboss.com/ )
(STEP1)
mkdir /websitedl/
cd /websitedl/
(STEP2)
  1. Create a virtualenv, mkvirtualenv lookup

  2. install opencv on mac via homebrew

brew tap homebrew/science
brew install opencv
cd ~/.virtualenvs/lookup/lib/python2.7/site-packages
ln -s /usr/local/Cellar/opencv/{VERSION_NUMBER}/lib/python2.7/site-packages/cv.py cv.py
ln -s /usr/local/Cellar/opencv/{VERSION_NUMBER}/lib/python2.7/site-packages/cv2.so cv2.so
[
{
"title": "Registry",
"description": "Docker image registry",
"categories": ["docker"],
"platform": "linux",
"logo": "https://cloudinovasi.id/assets/img/logos/registry.png",
"image": "registry:latest",
"ports": [
"5000/tcp"
<?php
/***************************************************************
* CSS REMOVE UNUSED RULES CLASS
* Run only in AMP pages
* Auther: Mike Lange
**************************************************************
HOW TO USE - BASIC:
$tmp = new AmpRemoveUnusedCss();
$tmp->process($htmlcode); //must be full htmlcode, with <style amp-custom> tag and the <body> content
echo $tmp->result();
After some trial and error, I finally figured out what the problem was and found a solution. Hopefully this will help those who come across this thread with the same problem.
The problem: Reformatting using Disk Utility did not create a child partition, but only formatted the whole drive as FAT. In Disk Utility one can derive this from the "Partition" button being greyed out when the USB drive is selected. In Terminal, the diskutil list command shows the USB drive having only one DeviceNode (labelled 0).
The solution: Reformatting the USB drive using diskutil in Terminal. This is the command line equivalent of Disk Utility, but unlike its GUI Counterpart, it creates a child partition, which in turn solves the error thrown by Boot Camp Assistant.
WARNING: Proceed with caution! If you have never used a command line interface before, you might want to ask a tech-savvy friend for help. I take no responsibility for the outcome of this. If you fry your hardware in the process, that's on you. Good luck!
Stepwise