Skip to content

Instantly share code, notes, and snippets.

View pauliusnorkus's full-sized avatar

Paulius Norkus pauliusnorkus

  • Vilnius, Lithuania
View GitHub Profile
using System;
namespace TestApp1
{
public static class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello");
}
https://adduplex.slack.com/files/U02CUR82F/FBGN0T943/liga_consolas.zip
#!/bin/sh
#
# /etc/init.d/kibana4 -- startup script for kibana4
# [email protected] 2015-02-20; used elasticsearch init script as template
# https://github.com/akabdog/scripts/edit/master/kibana4_init
#
### BEGIN INIT INFO
# Provides: kibana4
# Required-Start: $network $remote_fs $named
# Required-Stop: $network $remote_fs $named
{
"name": "kibana",
"private": true,
"main": "startup.js",
"scripts": {
"start": "node startup.js"
},
"dependencies": {
},
"devDependencies": {
@pauliusnorkus
pauliusnorkus / SqlHelpers.cs
Last active August 29, 2015 14:01
Helper method to cast SqlDataReader to generic list
public static class SqlHelpers
{
public static List<T> ToList<T>(this SqlDataReader reader)
{
var properties = typeof(T).GetProperties().Select(x => x.Name);
List<T> result = new List<T>();
while(reader.Read())
{
var instance = Activator.CreateInstance<T>();
foreach(var p in properties)
var self = this;
type.eachTransformedAttribute(function(key, type) {
var transform = self.transformFor(type);
data[key] = transform.deserialize(data[key]);
}, this);
App.PostSerializer = DS.RESTSerializer.extend({
primaryKey: 'postId'
});
DS.WebAPISerializer = DS.RESTSerializer.extend({
extractSingle: function (store, primaryType, payload, recordId, requestType) {
console.log(payload);
return this._super(store, primaryType, payload, recordId, requestType);
}
});
DS.WebAPIAdapter = DS.RESTAdapter.extend({
serializer: DS.WebAPISerializer
@pauliusnorkus
pauliusnorkus / HandlebarsBundleTransform.cs
Last active December 21, 2015 19:18
Handlebars Bundle Transform
public class HandlebarsBundleTransform : IBundleTransform
{
public void Process(BundleContext context, BundleResponse response)
{
var builder = new Ember.Handlebars.TemplateBuilder();
var usTextInfo = new CultureInfo("en-US", false).TextInfo;
foreach (var assetFile in response.Files)
{
var path = context.HttpContext.Server.MapPath(assetFile.VirtualFile.VirtualPath.Replace("/", "\\"));