This file contains hidden or 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
Sub DeleteRowByColumnValue() | |
Dim Firstrow As Long | |
Dim Lastrow As Long | |
Dim Lrow As Long | |
Dim CalcMode As Long | |
Dim ViewMode As Long | |
With Application | |
CalcMode = .Calculation | |
.Calculation = xlCalculationManual |
This file contains hidden or 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
grep -Po '"'"version"'"\s*:\s*"\K([^"]*)' package.json |
This file contains hidden or 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
# .bashrc | |
# alias for "d2u <filename>" which converts line endings from dos to unix using sed | |
alias d2u='function _d2u(){ echo "Converting line endings from Dos2Unix."; sed -i "s/\r$//" "$1"; };_d2u' | |
# alias for "untar" which executes "tar -xvf" to extract a tarball | |
alias untar='tar -xvf' | |
# alias for "tarball" which executes "tar cvzf" to create a tarball | |
alias targz='tar cvzf' |
This file contains hidden or 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.Management.Automation; | |
namespace ExecutePowershellCmdlet { | |
class Program { | |
using (PowerShell pshell = PowerShell.Create()) { | |
DateTime yesterday = DateTime.Today.AddDays(-1); | |
string date_string = "\"" + yesterday.ToString("MM"_ + "/" + yesterday.ToString("dd") + "/" + yesterday.ToString("yyyy") + "\""; // "MM/dd/yyyy" |
This file contains hidden or 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
#!/bin/bash | |
DEFAULT_VS_PROJECT_TOP_LEVEL_FOLDER="/e/dev/internal-apps" | |
# find all nested folders with a packages.config file (where the NuGet package references are stored) | |
# loop through the results | |
find ${1:-"${DEFAULT_VS_PROJECT_TOP_LEVEL_FOLDER}"} -name "packages.config" | while read -r filename ; do | |
echo | |
echo $(basename "$(dirname "$filename")") | |
cat "$filename" | grep "<package " | sed -n 's/.*id="\([^"]*\).*version="\([^"]*\).*/\1@\2/p' | sed 's/^/ |-/' |
This file contains hidden or 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
#!/bin/bash | |
DEFAULT_VS_PROJECT_TOP_LEVEL_FOLDER="/e/dev/internal-apps" | |
echo "Finding all projects using NuGet package for ${1}" | |
# find all nested folders with a packages.config file (where the NuGet package references are stored) | |
# loop through the results | |
find ${2:-"${DEFAULT_VS_PROJECT_TOP_LEVEL_FOLDER}"} -name "packages.config" -exec grep -l "${1}" {} \; | while read -r filename ; do | |
echo $(basename "$(dirname "$filename")") |
This file contains hidden or 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
#!/bin/bash | |
# generate root CA key | |
echo "Generating root CA key" | |
openssl genrsa -aes256 -out rootca.key 2048 | |
# generate root CA certificate (20 years) | |
echo "Generating root CA certificate" | |
openssl req -new -x509 -key rootca.key -days 7304 -sha256 |
This file contains hidden or 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
<?php | |
function random_bytes($bytes) { | |
$secure = true; | |
$buf = openssl_random_pseudo_bytes($bytes, $secure); | |
if ($buf !== false && $secure && strlen($buf) === $bytes) { | |
return $buf; | |
} | |
} |
This file contains hidden or 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
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Carbon\Carbon; | |
use Illuminate\Queue\Worker; | |
use Illuminate\Contracts\Queue\Job; | |
use Symfony\Component\Console\Input\InputOption; |
This file contains hidden or 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
cat log.log | grep '\[2016\-05' | cut -c 23- | sort | uniq -c | sort -rn > 2016-05_error_count.log |