Skip to content

Instantly share code, notes, and snippets.

@angelyordanov
angelyordanov / date_bindings.js
Last active December 12, 2015 06:38
The 'datePicker' and 'dateValue' knockout binding handlers.
function BindingHandlerFactory(bindingKey, handlerConstructor) {
this.init = $.proxy(this.init, this);
this.update = $.proxy(this.update, this);
this._jqDataKey = 'bhf.' + bindingKey;
this._handlerConstructor = handlerConstructor;
}
BindingHandlerFactory.prototype.init = function (element, valueAccessor) {
var self = this;
@angelyordanov
angelyordanov / protractorRunner.js
Last active December 31, 2015 14:59
A simple protractor runner task
/*global module, require, process*/
module.exports = function (grunt) {
'use strict';
var _ = require('lodash'),
protractorRunner = require('./node_modules/protractor/lib/runner.js'),
path = require('path');
grunt.registerMultiTask('protractor', 'Protractor runner.', function() {
var done = this.async(),
1. Once
git clone --mirror
2. To create a new bundle
git remote update
git bundle create my_repo.bundle --all
3. To restore the bundle
git clone my_repo.bundle
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopHScroll -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopHScroll 1 }
var modelState = actionContextAccessor.ActionContext.ModelState;
modelState.AddModelError(
nameof(data.UserVersion),
$"The {nameof(data.UserVersion)} field is required.");
return new BadRequestObjectResult(modelState);
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.DependencyInjection;
using System.Linq;
namespace FromSqlSample
{
class Program
{
static void Main(string[] args)
@angelyordanov
angelyordanov / osx_setup.md
Last active March 23, 2023 14:07 — forked from millermedeiros/osx_setup.md
Mac OS X setup

Setup Mac OS X

Edit: I've done the same process every couple years since 2013 (Mountain Lion, Mavericks and High Sierra).

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the process, but TBH I have this laptop for almost 3yrs and this is the first

# Install script for Kristoffer
# Created 06.08.2015
ECHO Installing apps
ECHO Configure chocolatey
choco feature enable -n allowGlobalConfirmation
#choco install visualstudiocode
choco install notepadplusplus
@angelyordanov
angelyordanov / chocolatey-env-setup.ps1
Last active November 27, 2019 16:58 — forked from amogram/chocolatey-env-setup.ps1
A Chocolatey script for PowerShell I use to set up my Windows development environment. I use this when setting up my own Dev VMs. Use at your own risk.See http://bit.ly/1a301JK and http://chocolatey.org/ for more information.
# Simple environment setup script
# First instal chocolatey
# https://chocolatey.org/install
choco feature enable -n allowGlobalConfirmation
# Install Applications
choco install git
choco install notepadplusplus
@angelyordanov
angelyordanov / Program.cs
Created December 13, 2019 08:56
bulgarian name regex
using System;
using System.Text.RegularExpressions;
public class Program
{
public static void Main()
{
// using the following unicode chars
// '\u002D' : - : HYPHEN-MINUS {hyphen or minus sign}
// '\u2010' : ‐ : HYPHEN