Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am davidedwards on github.
  • I am knossos (https://keybase.io/knossos) on keybase.
  • I have a public key ASBjBwId-pkg4AUZGFdqikvV8gaXZcyiCuZRreXlHQCg9Qo

To claim this, I am signing this object:

@DavidEdwards
DavidEdwards / eth_json_test.py
Created April 8, 2019 09:28
Convert a JSON formatted encrypted private key into a raw unencrypted private key (with options for testing against multiple passwords)
import hashlib
from Crypto.Hash import keccak
import codecs
from Crypto.Cipher import AES
from Crypto.Util import Counter
pws = [ "password1", "password2" ]
cipher = "0000000000000000000000000000000000000000000000000000000000000001"
salt = "0000000000000000000000000000000000000000000000000000000000000001"
iv = "00000000000000000000000000000001"
@DavidEdwards
DavidEdwards / delete.bat
Created December 1, 2017 11:24
Delete all files and directory structure at the given path
@echo off
REM Completely delete file / directory
echo Are you sure that you want to delete %1?
echo y/n
choice /c:yn > nul
if errorlevel 2 goto no
if errorlevel 1 goto start
@DavidEdwards
DavidEdwards / map.php
Created June 28, 2017 15:18
EVE Map Generator
<?php
define('DESIRED_SIZE', 1024);
/*
Two dependencies on SDE csv files.
https://www.fuzzwork.co.uk/dump/latest/
mapSolarSystems.csv
mapSolarSystemJumps.csv
@DavidEdwards
DavidEdwards / EVE-ESI-UserScript.js
Created January 20, 2017 08:56
Remove fluff from EvE ESI Swagger Page
// ==UserScript==
// @name Fix ESI
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove unnecessary content from ESI page
// @author Knossos
// @match https://esi.tech.ccp.is/*
// @grant none
// ==/UserScript==
@DavidEdwards
DavidEdwards / activity_example_two.xml
Created September 28, 2016 14:17
RecyclerView Grid Example
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
@DavidEdwards
DavidEdwards / ExampleOneActivity.java
Created September 28, 2016 14:12
RecyclerView Linear Template
/**
* This example contains 3 main parts.
*
* The main java code in ExampleOneActivity. This contains a dataset, a ViewHolder and an Adapter.
*
* The two XML snippets refer to the Activity layout XML and the ViewHolder (PersonHolder) layout XML.
*
* This example supports a LinearLayoutManager and an OnClickListener.
*
* The code for the Activity:
@DavidEdwards
DavidEdwards / GOG_Gangsters_Readme.txt
Last active January 22, 2018 07:05
A guide to playing Gangsters on modern hardware
Guide to playing Gangsters on Windows 10
---
0. Download and install "Oracle VM VirtualBox": https://www.virtualbox.org/
1. Download the "Windows XP Mode" installer: https://goo.gl/KvAb9O
2. This install only "works" on Windows 7. However, you can extract it.
3. Open the "WindowsXPMode_en-us.exe" file that you download with WinRAR or 7Zip (or your archiving
software of choice) and extract the files within.
4. Open the "sources" directory
5. Open the "xpm" file with WinRAR or 7Zip (or your archiving software of choice) and extract "VirtualXPVHD".
import android.text.TextUtils;
import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.Response;
public class ForceHttpsInterceptor implements Interceptor {
@Override