Skip to content

Instantly share code, notes, and snippets.

View kjellski's full-sized avatar
🤓
learning every day...

Kjellski kjellski

🤓
learning every day...
View GitHub Profile
/**
* Console.log with call location and grouping to reduce log noise.
* Apply directly to code once.
*
* Original: http://remysharp.com/2014/05/23/where-is-that-console-log/
*/
var groupable = typeof console.groupCollapsed !== 'undefined';
['log', 'warn'].forEach(function(method) {
var old = console[method];
console[method] = function() {
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
@kjellski
kjellski / linq-string-to-number.cs
Created December 5, 2013 08:43
conversion from string words to int
var s = "six thousand one thousand six hundred ninety two thirty three".Split(' ');
var map = new Dictionary<string, int>();
map.Add("one", 1);
map.Add("two", 2);
map.Add("three", 3);
map.Add("six", 6);
map.Add("thirty", 30);
map.Add("ninety", 90);
map.Add("hundred", 100);
--tree-filter 'rm -rf *.suo *.user *.sln.docstates [Dd]ebug [Dd]ebugPublic [Rr]elease x64 build bld [Bb]in [Oo]bj [Tt]est[Rr]esult* [Bb]uild[Ll]og.* *.VisualState.xml TestResult.xml *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.svclog *.scc _Chutzpah* ipch *.aps *.ncb *.opensdf *.sdf *.cachefile *.psess *.vsp *.vspx \$tf *.gpState _ReSharper* *.[Rr]e[Ss]harper *.DotSettings.user .JustCode _TeamCity* *.dotCover *.ncrunch* _NCrunch_* .*crunch*.local.xml *.mm.* AutoTest.Net [Ee]xpress DocProject/buildhelp DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html publish *.Publish.xml *.azurePubxml csx *.build.csdef AppPackages sql *.Cache ClientBin [Ss]tyle[Cc]op.* ~\$* *~ *.dbmdl *.dbproj.schemaview *.[Pp]ublish.xml *.pfx *.publishsettings Generated_Code _UpgradeReport_Files Backup* UpgradeLog*.XML UpgradeLog*.htm Ap
@kjellski
kjellski / canvas-data-service.js
Created November 28, 2013 21:18
This is the communication setup between to controllers, one needs data from the other.
'use strict';
var canvasDataServices = angular.module('CanvasDataServices', []);
canvasDataServices.service('CanvasDataService', ['$rootScope', '$q',
function CanvasDataService($rootScope, $q) {
var canvasDataService = {};
canvasDataService.requestCanvasJSON = function() {
this.deferred = $q.defer();
@kjellski
kjellski / gitorious_resque_debug_doc.md
Created November 28, 2013 13:20
gitorious documentation improvement for resque debugging...

debugging in gitorious

In case you're experiencing any errors or unexpected behaviour, these are stept to follow in order to narrow down the problem. The goal is to get the most out of your system that would help the developers to identify the problem and help you fixing your problem.

is the problem reproducable?

This is the most important question you should be able to answer. If not, it's really hard to help. If it is not happening all the time, more like "every now and then", try to document what happened before, each time something unexpected happens, write it down. Collects all informations arround the event that should succeed, but does not.

Try to answer these questions:

What steps will reproduce the problem?

@kjellski
kjellski / TextBoxLogger.cs
Created November 20, 2013 09:21
Create a commons logging adapter for WPF TextBox
using System;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using Common.Logging;
using Common.Logging.Simple;
namespace YourNamespace.Logging
{
/// <summary>
@kjellski
kjellski / gist:7526476
Created November 18, 2013 11:42
useless stacktrace
The type initializer for 'VMwareWrapper.RLVMwareController' threw an exception.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
@kjellski
kjellski / CreepCell.cs
Created November 3, 2013 18:55
Creeping With Unity
using System;
using UnityEngine;
[ExecuteInEditMode]
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(MeshCollider))]
public class CreepCell : MonoBehaviour, IFillable
private readonly Vector3[] _vertices = new Vector3[_verticesCount];
private readonly Vector3[] _normals = new Vector3[_verticesCount];