Skip to content

Instantly share code, notes, and snippets.

View warpech's full-sized avatar
🤹‍♂️
Code sweet code

Marcin Warpechowski warpech

🤹‍♂️
Code sweet code
View GitHub Profile
System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=Starcounter.Node
StackTrace:
at Starcounter.X.CheckLocalCache(String uri, Object userObject, Action`2 userDelegate, Response& resp)
at Starcounter.X.GET[T](String uri, Int32 receiveTimeoutMs)
at Page.AsMimeType(MimeType type) in c:\Sites\PMail\Server\Page.json.cs:line 10
at Starcounter.Internal.JsonMimeConverter.Convert(Request request, Object before, MimeType mimeType, MimeType& resultingMimeType)
at Starcounter.Json.AsMimeType(MimeType mimeType, MimeType& resultingMimeType, Request request)
Server responded with error 500 InternalServerError
Cannot access a disposed object.
at Starcounter.Transaction.SetCurrent(Transaction value)
at Starcounter.Internal.JsonPatch.JsonPatch.EvaluatePatches(Json rootApp, Byte[] body)
at Starcounter.Internal.SqlRestHandler.b__12(Session session, Request request)
at lambda_method(Closure , Request , IntPtr , IntPtr )
at Starcounter.Internal.HandlersManagement.RunDelegate(Request r, Response& resource)
at Starcounter.Internal.Web.AppRestServer.HandleRequest(Request request)
@warpech
warpech / gist:8453185
Created January 16, 2014 11:09
Better error message for replaced session in PuppetJS
Puppet.prototype.setReferer = function (referer) {
if(this.referer && this.referer !== referer) {
this.showError("Error: Session lost", "Server replied with a different session ID that was already set. \nPossibly a server restart happened while you were working. \nPlease reload the page.\n\nPrevious session ID: " + this.referer + "\nNew session ID: " + referer);
}
this.referer = referer;
};
@warpech
warpech / SentimentHelper.cs
Created January 3, 2016 19:26
Sentiment analysis that takes long time
using edu.stanford.nlp.ling;
using edu.stanford.nlp.neural.rnn;
using edu.stanford.nlp.pipeline;
using edu.stanford.nlp.sentiment;
using edu.stanford.nlp.trees;
using edu.stanford.nlp.util;
using java.io;
using java.text;
using java.util;
using Starcounter;
@warpech
warpech / Current.json
Created April 13, 2016 13:41
Current vs potential namespacing in JSON
{
"CurrentPage":{
"Launcher":{
"Html":""
},
"Products":{
"Html":""
}
}
}
@warpech
warpech / Master.html
Last active December 22, 2016 13:47
Sexy accessible, styleable buttons using SVG
<link rel="import" href="/sys/polymer/polymer.html">
<link rel="import" href="/sys/paper-icon-button/paper-icon-button.html">
<link rel="import" href="/CompositionEditor/elements/compositioneditor-inserter/compositioneditor-inserter.html">
<template>
<style>
.CompositionEditor-resetbutton {
margin: 0;
padding: 0;
border: 0;
<template>
<template is="dom-bind">
<starcounter-include view-model="{{model.currentPage}}">
</starcounter-include>
</template>
<palindrom-polymer-notifer></palindrom-polymer-notifer>
</template>
<template>
@warpech
warpech / script.js
Last active September 21, 2017 12:15
Tampermonkey script to display GitHub labels in search results and Notifications page
// ==UserScript==
// @name Show labels on GH
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://github.com/*
// @grant none
// ==/UserScript==
@warpech
warpech / README.md
Created November 24, 2017 18:11
Commit messages

Commit Messages

Commit messages should say why you made a change, not what you changed.

A good commit message has the following:

  • explanation of the problem
  • explanation of the solution
  • reference to the relevant GitHub issue
@warpech
warpech / README.md
Created November 29, 2017 10:22
An initial list of common, general-purpose web UI patterns
  1. Accordion. A list that can have a single item or multiple items expanded to show more detail.
  2. Alphabetic indices. Renders the characters in a culture’s alphabet in standard order (e.g., as a vertical or horizontal strip). If supplied with a set of strings, the UI will disable those characters which are not found as the initial character of any string.
  3. Async operation button. A button whose caption changes to reflect an operation in progress (e.g., changing from “Sign In” to “Signing In...”) until the operation completes.
  4. Auto-complete. A text input field that helps the user quickly enter strings from a known list.
  5. Auto-format. Applies a collection of heuristics for formatting text: adding smart quotes, converts double hyphens to endashes, etc.
  6. Auto-size text box. A text area that expands to contain its text.
  7. Backdrop. Shows a background region of non-interactive elements behind the region’s main contents.
  8. Blog. Shows some or all of the entries in the indicated RSS feed.
  9. Blog headlin