Skip to content

Instantly share code, notes, and snippets.

View prettycode's full-sized avatar

Chris prettycode

  • Seattle, WA
View GitHub Profile
@prettycode
prettycode / launch-cubitcrack.cs
Created December 2, 2023 14:54
Console app to launch cubitcrack.exe with specific range
// https://privatekeyfinder.io/bitcoin-puzzle/
using System;
using System.Diagnostics;
using System.Globalization;
using System.Numerics;
using System.Security.Cryptography;
namespace ConsoleApp
{
@prettycode
prettycode / textarea-maxlength.ie.shim.js
Last active August 23, 2023 14:48
jQuery shim for supporting <textarea> "maxlength" attribute in IE < 10.
// jQuery shim for supporting <textarea> `maxlength` attribute in IE < 10
// Author: Chris O'Brien, prettycode.org
// License: MIT
(function ($) {
// Target only IE browsers that don't support `maxlength`
if (typeof document.selection === 'undefined' ||
'maxLength' in document.createElement('textarea')
[[1668573462000,100.71000000],[1668506152000,50.00000000],[1668210910000,100.00000000],[1668210330000,100.00000000],[1668067775000,100.00000000],[1668067700000,100.00000000],[1668067367000,157.95000000],[1668067102000,100.00000000],[1668066686000,100.00000000],[1668062671000,100.00000000],[1668055236000,100.00000000],[1668630428000,50.05000000],[1668585071000,50.05000000],[1668540978000,50.05000000],[1668504907000,50.05000000],[1668461787000,50.05000000],[1668400309000,50.05000000],[1668357151000,50.05000000],[1668324223000,50.05000000],[1668281547000,50.05000000],[1668255413000,50.05000000],[1668216809000,50.05000000],[1668148629000,50.05000000],[1668105094000,50.05000000],[1668067290000,50.05000000],[1668024373000,50.05000000],[1668001100000,50.05000000],[1667966218000,50.05000000],[1667935158000,50.05000000],[1667880459000,50.05000000],[1667843281000,50.05000000],[1667640856000,50.05000000],[1667597656000,50.05000000],[1667534331000,50.05000000],[1667491223000,50.05000000],[1667449517000,50.05000000],[1667
@prettycode
prettycode / EventLogProgram.cs
Created May 8, 2013 02:43
Monitor for new Event Log entries. Basic proof-of-concept C# console app.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Threading;
using System.Security.Cryptography;
using System.Xml.Linq;
using System.Security;
@prettycode
prettycode / CryptoRandom.cs
Last active November 10, 2021 15:27
Cryptographically-strong random number generator in C#.
// Cryptographically-strong random number generator
// Source: MSDN Magazine > 2007 > September > .NET Matters: Tales from the CryptoRandom
// Source URL: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx
// Authors: Stephen Toub & Shawn Farkas
public class CryptoRandom : Random
{
private RNGCryptoServiceProvider cryptoProvider = new RNGCryptoServiceProvider();
private byte[] uint32Buffer = new byte[4];
@prettycode
prettycode / Win10-16257-Console-Colors.reg
Created November 19, 2017 17:01 — forked from richardszalay/Win10-16257-Console-Colors.reg
Applies the default console colors added in Windows 10 16256 (https://blogs.msdn.microsoft.com/commandline/2017/08/02/updating-the-windows-console-colors/) to older versions of Windows
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console]
"ColorTable00"=dword:000c0c0c
"ColorTable01"=dword:00da3700
"ColorTable02"=dword:000ea113
"ColorTable03"=dword:00dd963a
"ColorTable04"=dword:001f0fc5
"ColorTable05"=dword:00981788
"ColorTable06"=dword:00009cc1
@prettycode
prettycode / discoverPropertyPaths.js
Created June 29, 2016 04:33
Given an object, returns a list of property paths that can be used with lodash's _.get()
function discoverPropertyPaths(parentObject, parentPath) {
var paths = [],
propertyNames = Object.keys(parentObject);
propertyNames.forEach(function (propertyName) {
var propertyPath = (parentPath ? (parentPath + '.') : '') + propertyName,
property = parentObject[propertyName];
if (typeof property === 'object') {
var isArray = angular.isArray(property);
This file has been truncated, but you can view the full file.
[{"UtcTimestamp":"2016-04-17T00:00:03.790489Z","ConnectionInfo":{"FrontEnds":"USSEA-FE03.example.com","Pools":"USSEA-LYNCPOOL02.example.com","CallId":"339a818f-8ece-4d3e-a9b2-69089b52cdf5","ConversationId":"e4ac7ad284074ac3b7f7ec9df40384f3","TimeStamp":"2016-04-16T17:00:03.790489-07:00","Connectivity":"DIRECT","StartTime":"2016-04-16T16:59:06.8470034-07:00","EndTime":"2016-04-16T16:59:57.8111481-07:00","Originator":"c9b65aaf9"},"Info":{"ReceivedTime":"2016-04-17T00:00:04.0039754Z","ProcessingDuration":213,"MessageTypes":"qualityupdate qualityupdate ","ManagedThreadId":23,"EndpointUriFrom":"sip:pmus04@example.com","EndpointUriTo":"sip:+14258650735;ext=735;ms-skip-rnl@example.com;user=phone","ConnectivityType":0},"QualityUpdates":[{"From":{"Id":"61a55d8c9","URI":"sip:+14258650735;ext=735;ms-skip-rnl@example.com;user=phone","Contact":"sip:USSEA-FE03.example.com@example.com;gruu;opaque=srvr:MediationServer:tfj0lJ9BU1WVYJh6-_VXBAAA;grid=5a9a9dc63672446b95fa634d1a1d5ac7","IP":"64.94.116.113","UserAgent":"RTCC/6.0.0
@prettycode
prettycode / Model.prototype.$extended
Created April 10, 2016 03:07
Evaluate functions on object
Model.prototype.$extended = function () {
var thisModel = this,
extendedModel = angular.copy(thisModel);
Object
.keys(thisModel)
.filter(key => typeof thisModel[key] === 'function')
.forEach(key => {
try {
extendedModel[key] = thisModel[key]();
@prettycode
prettycode / article.htm
Created June 3, 2013 14:49
HTML layout with paper-page styling.
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
width: 100%;
padding: 0;
margin: 0;
background-color: #F0F0F0;