View pom.xml
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.test</groupId> | |
<artifactId>test-project</artifactId> | |
<version>1.0</version> |
View countLines.go
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
// source https://stackoverflow.com/questions/24562942/golang-how-do-i-determine-the-number-of-lines-in-a-file-efficiently | |
func lineCounter(r io.Reader) (int, error) { | |
buf := make([]byte, 32*1024) | |
count := 0 | |
lineSep := []byte{'\n'} | |
for { | |
c, err := r.Read(buf) | |
count += bytes.Count(buf[:c], lineSep) |
View userChrome.css
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
#TabsToolbar > .toolbar-items, | |
#TabsToolbar > .titlebar-spacer{ visibility: hidden } | |
#nav-bar{ margin-top: -43px;padding: 1px 140px 2px 3px !important; } |
View CopyDirectory.cs
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; | |
class DirectoryCopyExample | |
{ | |
static void Main() | |
{ | |
// Copy from the current directory, include subdirectories. | |
DirectoryCopy(".", @".\temp", true); | |
} |
View CopyFolder.ps1
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
Copy-Item c:\fso –destination \\server1\share -recurse -container |
View ReadWriteDateToFile.ps1
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
$date = Get-Date -format "yyyyMMdd" | |
$date | Out-File c:\test.txt | |
$text = Get-Content c:\test.txt | |
$date = [datetime]::ParseExact($date, "yyyyMMdd", $null) |
View GetFilesNewerThatDate.ps1
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
Get-ChildItem -Path . -Recurse| ? {$_.LastWriteTime -gt (Get-Date).AddDays(-4)} |
View IsFileLocked.cs
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
protected virtual bool IsFileLocked(FileInfo file) | |
{ | |
FileStream stream = null; | |
try | |
{ | |
stream = file.Open(FileMode.Open, FileAccess.Read, FileShare.None); | |
} | |
catch (IOException) | |
{ |
View NetworkConnection.cs
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
public class NetworkConnection : IDisposable | |
{ | |
string _networkName; | |
public NetworkConnection(string networkName, | |
NetworkCredential credentials) | |
{ | |
_networkName = networkName; | |
var netResource = new NetResource() |
NewerOlder