Skip to content

Instantly share code, notes, and snippets.

@tfwio
tfwio / commander.cs
Last active December 23, 2015 11:09
a batch file-rename tool that could use some work.
#region User/License
// Copyright (c) 2005-2013 tfwroble
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
@tfwio
tfwio / makelink.cmd
Last active December 23, 2015 18:49
MSYS postinstall configuration for using or switching between many different MinGW configurations. Eventually I hope to automate this guy among other things.
@tfwio
tfwio / fparams-dic.cs
Created September 27, 2013 10:19
A code explanation of the supported field-element-tags in a template-based cs-code-generator app; Granted there are extension methods at play here, but it still explains a good number of the tags, currently.
//
DICT <string,object> fparams = new DICT <string,object>();
//
fparams.Add("Date", string.Format("MM/dd/yyyy",DateTime.Now));
fparams.Add("Time", string.Format("hh:mm.ss tttt",DateTime.Now));
fparams.Add("DateTime", string.Format("MM/dd/yyyy hh:mm.ss tttt",DateTime.Now));
//
fparams.Add("DataName", DataName);
fparams.Add("dataname", DataName.ToLower());
fparams.Add("DataNameC", dataName.Capitolize());
@tfwio
tfwio / jquery.tfoxo-box.js
Last active December 25, 2015 12:29
semi-useless, undocumented crap especially because I cant remember where or why
(function($){
// TODO: adequate coding conventions
//¿useless!
$.fox = function()
{
var
a = { fun: function(name,action,mthd) { $(name).unbind(action,mthd); $(name).bind(action,mthd); } };
return false;
@tfwio
tfwio / README.md
Last active December 26, 2015 15:49
Two helper snipits (not to forget) for reading from shoutcast streams in Microsoft.NET applications (app.config), of which one or the other may be used. See the readme for info on how to use and the source (forum post).

SetAllowUnsafeHeaderParsing Snippits

Brief

Either of the two provided snipts address the same issue.

  • the csharp file addresses the issue with a block of code you should call in your 'main' program-process.
  • the xml app.config may alternatively be used for brevity.

Why

@tfwio
tfwio / GitInfoProvider.cs
Last active December 28, 2015 00:19
Searches "%programfiles%/git/bin/" and "%programfiles (x86)%/git/bin/" for existing 'git.exe' (so you don't need git.exe in your environment path). Original source: http://versioning.codeplex.com/SourceControl/latest#MSBuildVersioning/GitInfoProvider.cs
using System;
namespace MSBuildVersioning
{
/// <summary>
/// Provides Mercurial information for a particular file path, by executing and scraping
/// information from the hg.exe command-line program.
/// </summary>
public class GitInfoProvider : SourceControlInfoProvider
{
@tfwio
tfwio / ReadingPage.md
Last active February 5, 2017 10:44
tfwxo/readme (wp-page-content)
  • Calibre allows you to organize your ebook messes of messes into tidy libraries (it did for me).
  • SumatraPDF for WINDOWS uses MuPDF, and can "read" DJVU, EPUB, MOBI, AZW/AZW3, PDF, and more.
  • DjVuLibre DjVu ebook reading software for WIN, MAC and GNU/LINUX is worth pointing out (if you don't have windows/SumatraPDF).
  • On-line sources for digital books predominantly in PDF format and other formats such as TeX, EPUB, MOBI (Kindle), Etc...
  • featured here: tfwxo.wordpress.com/readme, gist
  • This page is a continuous work in progress, started as a programming book library page for the programming section of this site.

TOC

----
@tfwio
tfwio / Demo-AssemblyInfo.cs
Created June 10, 2014 06:03
SvnInfo MSBuild ingegration
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
@tfwio
tfwio / AssemblyInfo-snippit.cs
Last active August 29, 2015 14:02
Get StrongKeyName and StrongKey from an assembly (windows batch command)
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// to be added to your AssemblyInfo.cs
// do not overwrite your assemblyinfo.cs file with this one!
[assembly: InternalsVisibleTo("[Your-AssemblyName],PublicKey=...")]
@tfwio
tfwio / LocalMuiSettings.cs
Last active August 29, 2015 14:02
windows csharp registry reader/writer snippit. How to implement would be to add a call to LocalMuiSettings.Assert() after the window's call to InitializeComponent().
using System;
using System.Linq;
using System.Windows.Media;
using FntSize = FirstFloor.ModernUI.Presentation.FontSize;
namespace genericwav
{
static class LocalMuiSettings
{