Skip to content

Instantly share code, notes, and snippets.

🤹‍♂️
Code sweet code

Marcin Warpechowski warpech

View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Noop that returns</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@warpech
warpech / Convert.cs
Last active Sep 18, 2018
Convert ObjectNo to ObjectId
View Convert.cs
using System;
using System.Linq;
//Usage examples:
//
//star Convert.cs 6513
//star Convert.cs Blx
//
//Warning: the output goes to Starcounter Administrator
@warpech
warpech / README.md
Created Nov 29, 2017
An initial list of common, general-purpose web UI patterns
View README.md
  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
@warpech
warpech / README.md
Created Nov 24, 2017
Commit messages
View README.md

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 / script.js
Last active Sep 21, 2017
Tampermonkey script to display GitHub labels in search results and Notifications page
View script.js
// ==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==
View gist:f6722f2dcb2e6b9b418ed835c632575a
<template>
<template is="dom-bind">
<starcounter-include view-model="{{model.currentPage}}">
</starcounter-include>
</template>
<palindrom-polymer-notifer></palindrom-polymer-notifer>
</template>
<template>
@warpech
warpech / Master.html
Last active Dec 22, 2016
Sexy accessible, styleable buttons using SVG
View Master.html
<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;
@warpech
warpech / Current.json
Created Apr 13, 2016
Current vs potential namespacing in JSON
View Current.json
{
"CurrentPage":{
"Launcher":{
"Html":""
},
"Products":{
"Html":""
}
}
}
@warpech
warpech / SentimentHelper.cs
Created Jan 3, 2016
Sentiment analysis that takes long time
View SentimentHelper.cs
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 / nodeapp.js
Created Feb 20, 2015
Man in the middle
View nodeapp.js
var express = require('express')
var bodyParser = require('body-parser');
var chalk = require('chalk');
var app = express()
app.use(bodyParser.text());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, spy-type");
You can’t perform that action at this time.