Skip to content

Instantly share code, notes, and snippets.

View nedyalkov's full-sized avatar

Miroslav Nedyalkov nedyalkov

View GitHub Profile
@nedyalkov
nedyalkov / author_summary.sh
Created August 9, 2019 20:26
Get a contributions summary for an author prior to a date
AUTHOR=$1
FIRST_DAY=$2
echo "First contribution of $AUTHOR was done on: `git log --reverse --author="$AUTHOR" --until "$FIRST_DAY" -n 1 --pretty=%aI`"
CONTRIBUTIONS_SUMMARY=`git log --author="$AUTHOR" --pretty=tformat: --numstat --until "$FIRST_DAY" \
| awk '{ add += $1; subs += $2; loc += $1 - $2 } END \
{ printf "added lines(+): %s; removed lines(-): %s, total lines: %s\n", add, subs, loc }'`
echo "Contributions until $FIRST_DAY: $CONTRIBUTIONS_SUMMARY"
@nedyalkov
nedyalkov / schedulerTimeMarker.js
Created June 22, 2017 08:35
Implements an Angular Directive to show a custom time tick for the Kendo UI Scheduler
define(['../module', 'lodash', 'moment', 'schedulerService', 'utils'],
function (module, _, moment, schedulerService, utils) {
function directive($interpolate, $timeout) {
function link($scope, element, attrs) {
let widget;
function ensureTick(element, offset, isVertical) {
let tick = element.find('.rnd-k-scheduler-tick');
if (tick.length === 0) {
brew uninstall node
brew install https://raw.githubusercontent.com/Homebrew/homebrew-versions/master/node010.rb
npm install -g npm@latest
@nedyalkov
nedyalkov / gist:a563dd4fb04d21cb91dc
Created September 11, 2014 08:37
SignFile with Sha1 algorithm when using Sha256 certificate
function SignFile($filePath, $timeStampUri, $certThumbprint)
{
$x509Store = New-Object -TypeName ([System.Security.Cryptography.X509Certificates.X509Store]) -ArgumentList ([System.Security.Cryptography.X509Certificates.StoreName]::My),([System.Security.Cryptography.X509Certificates.StoreLocation]::CurrentUser)
try
{
$x509Store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadOnly)
$x509Certificate2Collection = $x509Store.Certificates.Find([System.Security.Cryptography.X509Certificates.X509FindType]::FindByThumbprint, $certThumbprint, $false);
if ($x509Certificate2Collection.Count -eq 1)
{
$cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]@($x509Certificate2Collection)[0]