Skip to content

Instantly share code, notes, and snippets.

View kmorcinek's full-sized avatar

Krzysztof Morcinek kmorcinek

View GitHub Profile
Lesson 3:
ganske, så mye, meget bra, I think(sines), men, bare,
Lesson 4:
storting, gata, Stortingsgata, veien, hvor, her, der borte, tusen takk
@kmorcinek
kmorcinek / javascript.txt
Created March 11, 2013 22:33
My JavaScript stuff
= value || 0;
var Tekpub = Tekpub || {};Tekpub.CartItem = function (options, callback) { - namespace
dont 'new' 29min. http://www.youtube.com/watch?v=hQVTIJBZook
Closure 28min. http://www.youtube.com/watch?v=hQVTIJBZook
var value = items["dfs"];if(value === undefined) ...
@kmorcinek
kmorcinek / Knockoutjs
Last active December 14, 2015 19:39
Usefull Knockoutjs stuff
ko.dataFor
ko.computed({ //}, viewModel); - second parameter as a context.
viewModel.whoAmI = function() { alert(this.name);}.bind(viewModel);
<script type="text/html" id="person-template">
<pre data-bind="text: ko.toJSON($root, null, 2)"></pre>
@kmorcinek
kmorcinek / UsefullHelpers.cs
Created July 8, 2012 14:14
Usefull functions for C#
using System;
using System.IO;
public static class PathHelper
{
public static bool AreEqualPath(string first, string second)
{
return String.Compare(
Path.GetFullPath(first).TrimEnd('\\'),
Path.GetFullPath(second).TrimEnd('\\'),
@kmorcinek
kmorcinek / git commands.txt
Last active September 30, 2023 09:16
Git Commands. My common scenarios for using git.
# good git book
http://git-scm.com/book
# Discard uncommitted changes in a specific file
git checkout file_name
# Clear everything not in repo
git checkout -- .
# A way to quickly move to the previous commit in a git branch. This also way for "deleting" last commit.
@kmorcinek
kmorcinek / DictionaryHelpers.cs
Created June 19, 2012 10:23
Extension methods for generic Dictionary
using System.Collections.Generic;
namespace KMorcinek.Common
{
public static class DictionaryExtensions
{
public static void IncrementAt<T>(this Dictionary<T, int> dictionary, T index)
{
int count = 0;
@kmorcinek
kmorcinek / .gitignore
Last active May 15, 2024 09:58
.gitignore for C# projects
# The following command works for downloading when using Git for Windows:
# curl -LOf http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
#
# Download this file using PowerShell v3 under Windows with the following comand:
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
#
# or wget:
# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
# User-specific files