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)
# 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
@angelyordanov
angelyordanov / curl_webpage.sh
Created December 23, 2019 10:27
cUrl get webpage html every 2 seconds
while :; \
do \
curl 'https://google.com/' \
-H 'Connection: keep-alive' \
-H 'Upgrade-Insecure-Requests: 1' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36' \
-H 'Sec-Fetch-User: ?1' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
-H 'Sec-Fetch-Site: none' -H 'Sec-Fetch-Mode: navigate' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9,bg;q=0.8' \
--compressed \