This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The CSV file produced by Relenta while exporting contact is somewhat messy. | |
// Using this tiny app to extract the first email address of each contact. | |
using System; | |
using System.IO; | |
namespace ConsoleTest | |
{ | |
class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Measure-Loc | |
# By Joannes Vermorel, 2010 | |
# Recurse directories and compute the number of C# lines | |
# Usage: measure-loc | |
function Measure-Loc | |
{ | |
param( | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for /f "tokens=* delims=" %%i in ('dir /s /b /a:d *.svn') do ( | |
rd /s /q "%%i" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Iterate through all subdirectories, and perform Git fetch, then Git rebase | |
on each subdirectory. | |
Joannes Vermorel, 2012-04-25 | |
#> | |
$initpath = get-location | |
foreach($path in get-childitem) { | |
if ($path.Attributes -eq "Directory") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Text; | |
namespace Loader | |
{ | |
class FlatSampling | |
{ | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Net; | |
using System.Security.Principal; | |
using System.Text; | |
using System.Web; | |
using System.Web.Mvc; | |
namespace ClientUI | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace commas by dots in a very large file (full streaming) | |
$infile = ls .\MyFile.csv | |
$outfile = $infile.DirectoryName + "\MyFile.csv.out" | |
$reader = [System.IO.File]::OpenText($infile.FullName) | |
$writer = [System.IO.StreamWriter] $outfile | |
try { | |
for(;;) { | |
$line = $reader.ReadLine() | |
if ($line -eq $null) { break } | |
# process the line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample-Content | |
# By Joannes Vermorel, 2014 | |
# Keep only 1 line out of N of a flat file | |
# Usage: sample-content .\myfile.csv 100 | |
function Sample-Content() | |
{ | |
param | |
( | |
[string]$path = $null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------------------- | |
# function Search-LokadWiki | |
# By Joannes Vermorel, Oct 2015, Lokad | |
# | |
# Print all the wiki page names that contains a specific string | |
# in their wiki code. | |
#---------------------------------------------------------------- | |
function Search-LokadWiki() | |
{ | |
param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cross-Join between two flat files | |
# By Joannes Vermorel, 2015-12-11 | |
# | |
# Syntax: | |
# Crossjoin-Csv .\sample.csv .\sample.csv "Name" | |
function Crossjoin-Csv | |
{ | |
param | |
( |
OlderNewer