Skip to content

Instantly share code, notes, and snippets.

import bs4 import requests
import re
code = '''
"kcaKrEV6f1Q",
"2yWwlill8dc",
"FQRIjzW-kg0",
"sGobBjJPJKk",
"qbgpn-twcSI",
"ynufwsOiZYg",
@nyctef
nyctef / foo.md
Created July 30, 2015 21:21
Unpackage a nuget package

based on http://stackoverflow.com/a/508030/895407

        private static void ExtractPackage(string packageFilename, DirectoryInfo toFolder)
        {
            using (var package = Package.Open(packageFilename))
            {
                ExtractPackage(package, extractedCommandlineFolder);
            }
        }
# usage:
# ~ $log = init "D:\SteamLibrary\SteamApps\common\Worms Armageddon\User\Games\2016-02-18 17.52.14 [Online] foo, bar.WAgame"
# ~ summarizelog $log
# ~ specificturn $log 3
$wormsRoot = (Get-ItemProperty HKCU:\SOFTWARE\Team17SoftwareLTD\WormsArmageddon).PATH
$wa = join-path $wormsRoot WA.exe
$wacapture = join-path $wormsRoot User\Capture
$imageMagickRoot = (Get-ItemProperty HKLM:\SOFTWARE\ImageMagick\Current).BinPath
$convert = join-path $imageMagickRoot convert.exe
@nyctef
nyctef / output.txt
Created December 13, 2015 21:47
fun with DNX and FluentAssertions
C:\git\slackist\Slackist.Tests [master ↑ +0 ~2 -0 !]> dnx test -method Tests.CanConnectToSlack
xUnit.net DNX Runner (64-bit DNXCore 5.0)
Discovering: Slackist.Tests
Discovered: Slackist.Tests
Starting: Slackist.Tests
Tests.CanConnectToSlack [FAIL]
Expected string not to be <null> because we need an API token to connect to slack.
Stack Trace:
C:\projects\fluentassertions-vf06b\Src\Shared\Execution\LateBoundTestFramework.cs(26,0): at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
C:\projects\fluentassertions-vf06b\Src\Core\Execution\AssertionScope.cs(197,0): at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args)
@nyctef
nyctef / hsbc.js
Created January 17, 2016 13:47
Pull csv from hsbc statements
(function(window) {
// based on https://github.com/dahousecat/hsbc-statement-to-csv/blob/master/create-csv.js
function assert(condition, message) {
if (!condition) throw message || "Assertion failed";
}
assert($, "need jquery")
assert($('table[summary*="This table contains"] thead').length == 1, "expecting one table head")
# courtesy of http://stackoverflow.com/questions/4006324/how-to-atomically-delete-keys-matching-a-pattern-using-redis
EVAL "for _,k in ipairs(redis.call('keys', 'seq*')) do redis.call('del', k) end" 0
@nyctef
nyctef / line-endings.vim
Created April 25, 2017 15:40
highlight line endings from a hex dump
match DiffDelete /0d/
2match DiffChange /0a/
3match DiffAdd /\v(0a )@!0d 0a/
@nyctef
nyctef / gist:5d4be79a427d99e44fc00fe4b24af9ae
Last active May 5, 2017 13:35
analyze msbuild log for warnings
exec '/\v^([ 0-9>]*)(.+) (warning [^ ]+): (.*$)/<cr>'
%v//d
%s//\3 : \4 | \2/g
sort
@nyctef
nyctef / example.md
Last active November 15, 2017 02:22
Don't make decisions across different levels of abstraction

instead of

if (use_alternate_frob_strategy) {
  bloo_counter += 1;
}

do

@nyctef
nyctef / deletebranches.ps1
Created December 4, 2017 12:51
delete branches with confirmation
function confirm($message) {
$reply = Read-Host -Prompt "$message [y/n]"
return $reply -match "[yY]"
}
git for-each-ref --format='%(refname:short)' refs/heads | `
where { $_ -ne 'master' } | `
where { confirm "Delete branch $_ ?" } | `
foreach { echo "git branch -D $_" }