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
<Project DefaultTargets="CopyOutputs;DeployService" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!-- These settings control what the service's name, description etc appear in services.msc task panel. -->
<PropertyGroup Label="ServiceMetaData">
<ServiceName>ShinyNewService</ServiceName>
<ServiceDisplayName>Shiny New Service</ServiceDisplayName>
<ServiceDescription>A shiny new service, that changes the world for the greater good.</ServiceDescription>
</PropertyGroup>
<Choose>
@kjellski
kjellski / sublime_open_as.reg
Created September 18, 2013 16:59
Open folder in Sublime Text 2 by "right clickt context menu"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Open folder as Sublime Text 2 Project]@="Open folder as Sublime Text 2 Project"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Open folder as Sublime Text 2 Project\command]@="C:\\Program Files\\Sublime Text 2\\sublime_text.exe" %1
@kjellski
kjellski / LambdaComparer.cs
Created September 5, 2013 14:15
LambdaComparer, not mine though, but I can't remember where on SO I found it...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Utils
{
/// <summary>
/// Creates an Comparer for a type
/// </summary>
@kjellski
kjellski / RLUtils.Logging.config
Created September 2, 2013 13:01
web.config referencing Logging config
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
<listeners>
<add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
source="Enterprise Library Logging" formatter="Complete Text Formatter"
@kjellski
kjellski / empty.lua
Created August 28, 2013 13:15
Put this into /etc/xdg/awesome/rc.lua and /usr/share/awesome/themes/default/empty.lua for a maximized window completely without menues and decorators. :)
---------------------------
-- Default awesome theme --
---------------------------
theme = {}
theme.font = "sans 8"
theme.bg_normal = "#222222"
theme.bg_focus = "#535d6c"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RLUtils
{
/// <summary>
/// Creates an Comparer for a type
/// </summary>
#!/bin/bash
# Description: Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance
# Author: Adam Awan
# Email: adam@tree.io
# Create a PostgreSQL Instance
echo "Retrieving jpetazzo/pglite PostgreSQL Container..."
docker pull jpetazzo/pglite
echo "Running jpetazzo/pglite PostgreSQL Container..."
PGID=$(docker run -d jpetazzo/pglite)
@kjellski
kjellski / migrations
Last active December 17, 2015 16:29
has_and_belongs_to_many confusion
class Poi < ActiveRecord::Base
attr_accessible :activities
has_and_belongs_to_many :activities
end
class Activity < ActiveRecord::Base
attr_accessible :pois
has_and_belongs_to_many :pois
end
@kjellski
kjellski / openstack - stack.sh
Last active December 17, 2015 11:49
openstack
[~/Projects/devstack (master)]$ sudo ./stack.sh
[sudo] password for kjellski:
You are running this script as root.
In 10 seconds, we will create a user 'stack' and run as that user
Giving stack user passwordless sudo privileges
Copying files to stack user
Using mysql database backend
+ echo_summary 'Installing package prerequisites'
+ [[ -t 3 ]]
+ [[ True != \T\r\u\e ]]
object FizzBuzz extends App {
val nones = Stream.continually(None)
val fizzes: Stream[Option[String]] = nones.take(2) ++ Some("Fizz") #:: fizzes
val buzzes: Stream[Option[String]] = nones.take(4) ++ Some("Buzz") #:: buzzes
for (((fizz, buzz), n) <- fizzes zip buzzes zip (1 to 100)) {
println(fizz.map(_ + buzz.getOrElse("")).orElse(buzz).getOrElse(n))
}