Skip to content

Instantly share code, notes, and snippets.

View DanTup's full-sized avatar

Danny Tuppeny DanTup

  • Coded Consultants Ltd
  • England, UK
  • 10:09 (UTC +01:00)
  • X @DanTup
View GitHub Profile
@DanTup
DanTup / proxy_test.dart
Created January 2, 2019 09:56
Dart localhost WebSocket proxy test script
import 'dart:io';
var port = 3456;
main() async {
print('HTTP_PROXY: ${Platform.environment['HTTP_PROXY']}');
print('NO_PROXY: ${Platform.environment['NO_PROXY']}');
print('');
await test('ws://echo.websocket.org');
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@DanTup
DanTup / PowerShellHere.reg
Created February 1, 2014 11:28
Creates "PowerShell Here" shortcuts on context menu for right-clicking folders, blank background space, blank background space in libraries. Preserves default PowerShell colours/settings.
Windows Registry Editor Version 5.00
; Creates "PowerShell Here" shortcuts on context menu for
;
; a) right-clicking on a folder
; b) right-clicking in the blank space when inside a folder (eg. already inside the folder)
; c) right-clicking in the blank space when inside a folder that's inside a library
;
; Uses cmd start to launch normal Powershell shortcut so that the normal PowerShell shortcut
; colours/settings are preserved (blue, not black/white)
@DanTup
DanTup / default.htm
Created July 9, 2013 15:24
Strange IE10 issue. In IE7/8/9 this code will throw an error (attributes["onchange"] returns null). But in IE10, magic happens, and attributes["onchange"] returns attributes["name"] and the code alerts the name of the element!
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
</head>
<frameset rows="70,*">
<frame src="about:blank">
<frameset cols="165,*">
<frame src="about:blank">
<frame src="settings.htm">
@DanTup
DanTup / LaunchKiln.ps1
Last active May 11, 2018 18:43
PowerShell function to launch Kiln in a browser for the repo you're currently in.
# Launch Kiln for current repo
Function Kiln
{
if (Test-Path ".\.hg\hgrc")
{
$repoUrl = (Select-String "default = (.*)" -Path ".\.hg\hgrc" -AllMatches).Matches.Groups[1].Value
Start $repoUrl
}
else
{ Write-Warning "Not in a repo!" }
@DanTup
DanTup / VS References Yuml.ps1
Last active October 4, 2015 10:47
Output Visual Studio project references for yuml.me
function Get-ProjectReferences
{
param(
[Parameter(Mandatory)]
[string]$rootFolder,
[string[]]$excludeProjectsContaining
)
dir $rootFolder -Filter *.csproj -Recurse |