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
#!/bin/sh
# install build dependencies
sudo apt-get install git mono-mcs mono-gmcs mono-devel autoconf libtool g++ gettext libglib2.0-cil-dev libgtk2.0-cil-dev libglade2.0-cil-dev libgnome2.0-cil-dev libgconf2.0-cil-dev
# add the ssl certs
sudo certmgr -ssl -m https://go.microsoft.com
sudo certmgr -ssl -m https://nugetgallery.blob.core.windows.net
sudo certmgr -ssl -m https://nuget.org
mozroots --import --sync
/**
* 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() {
public class OctopusRestApi : ApiDefinition
{
public OctopusRestApi()
{
#region Projects
Get["/api/projects/all"] = ListAll<ProjectSummaryIndex, Project, ProjectResource>()
.WithDescription("Lists the name and ID of all of the projects in the current Octopus installation. The results will be sorted alphabetically by name.")
.WithCustomQuery(projects => projects.OrderBy(m => m.Name));
Get["/api/projects/{id}"] = Load<Project, ProjectResource>()
/// <summary>
/// Executes a particular piece of code based on the type of the argument.
/// </summary>
public static class TypeSwitch
{
/// <summary>
/// Executes a particular piece of code based on the type of the argument.
/// </summary>
/// <typeparam name="TSource">The argument's type.</typeparam>
/// <param name="value">The switch argument.</param>
# ~/.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?