Skip to content

Instantly share code, notes, and snippets.

View IliaIdakiev's full-sized avatar
:octocat:
Currently Coding...

iliya idakiev IliaIdakiev

:octocat:
Currently Coding...
View GitHub Profile
function curry(fn) {
return function helper(...args) {
if (args.length === fn.length) { return fn(...args); }
return function (...newArgs) {
return helper(...args.concat(newArgs));
};
};
}
@IliaIdakiev
IliaIdakiev / C# number to comma separated string
Created November 28, 2013 12:38
C# number to comma separated string
double number = 2000.4;
number.ToString("#,##0.##")
$(document).bind("keydown", disableF5);
function disableF5(e) {
if ((e.which || e.keyCode) == 116) {
if(confirm("Are you sure you want to continue? You will loose some of the filled information!")){
return true;
}
else{
e.preventDefault();
}
@IliaIdakiev
IliaIdakiev / new_gist_file
Created September 5, 2013 11:58
Check / Uncheck Checkbox multiple times ! PROP
var selectedIds = JSON.parse('@Html.Raw(Json.Encode(@Model.DuplicateIds))');
if (jQuery.inArray(id, selectedIds) != -1) {
$("#isDuplicate").prop('checked', true);
} else {
$("#isDuplicate").prop('checked', false);
}
@IliaIdakiev
IliaIdakiev / new_gist_file
Created September 5, 2013 11:33
Razor Parse C# List To Javascript array
var arr = JSON.parse('@Html.Raw(Json.Encode(@Model.DuplicateIds))')
@IliaIdakiev
IliaIdakiev / MVC JS redirect
Created July 23, 2013 12:51
Javascript Redirect to current page another controller
function impersonate(id) {
if (confirm('Are you sure?')) {
var url = 'Account/PresentationImpersonateTo/' + id;
window.location.href = url;
}
}
#import <Cocoa/Cocoa.h>
@interface FMICustomSlider : NSView
{
NSGradient* gradient;
CGFloat angle;
}
@property (nonatomic) NSGradient* gradient;
@property (nonatomic) CGFloat angle;