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
@warpech
warpech / tasks.md
Last active August 29, 2015 14:00
Mayflower tasks list

Additional functionality

@warpech
warpech / gist:a66d992720d30d0507f7
Last active August 29, 2015 14:07
Client-server versioning in Puppets

Optional version control

Because of the asynchronous nature of bidirectional client-server communication (caused by network latency, server side push, etc), it can be assumed that client and the server state is always out of sync.

To solve the problem expressing changes in the view-model, optional server and client state versioning is introduced:

{
  "_ServerVersion": 0, 
 "_ClientVersion$": 0, 
@warpech
warpech / find-links.sh
Created December 18, 2014 12:12
Find Gollum linked pages and orphans
@warpech
warpech / nodeapp.js
Created February 20, 2015 12:57
Man in the middle
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");
@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