Skip to content

Instantly share code, notes, and snippets.

View molcik's full-sized avatar
👀
Status: In Progress

Filip Molcik molcik

👀
Status: In Progress
View GitHub Profile
@molcik
molcik / ligature-icon-font.html
Last active December 21, 2016 20:01
Usage of ligature icon font
<!-- include font stylesheet in your <head> -->
<head>
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<!-- use it in your template -->
<div class="material-icons">
<a href="#">home</a>
<a href="#">face</a>
@molcik
molcik / advent-of-code-day-7.js
Last active December 21, 2016 19:57
My solution for day 7 puzzle at adventofcode.com
let data = `xdsqxnovprgovwzkus[fmadbfsbqwzzrzrgdg]aeqornszgvbizdm
itgslvpxoqqakli[arktzcssgkxktejbno]wsgkbwwtbmfnddt[zblrboqsvezcgfmfvcz]iwyhyatqetsreeyhh
...
kpglgg[mpvkikuabwucwlpqf]cmzkcdnrhwjmfgbmlq
spwwppgjgfexuezrixp[rotgzyxzqxyrroafx]tkwxfiamzdjdqpftvq`;
let dataArray = data.split(/\n/);
// finds ABBA pattern in square brackets
let inBracketsRegEx = /(?=\[[a-z]*([a-z])([a-z])\2\1[a-z]*\])(?!\[[a-z]*([a-z])\1{3}[a-z]*\])/;
// finds ABBA pattern
@molcik
molcik / md-spinner.svg.xml
Last active November 6, 2017 04:04
Angular 2 material design spinner in .svg
<svg class="spinner" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" >
<style>
.spinner {
animation: rotator 5s linear infinite;
transform-origin: center;
}
@keyframes rotator {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
/**
* LocalStorage for storing string values
*/
export function LocalStorage(
target: Object, // The prototype of the class
decoratedPropertyName: string // The name of the property
) {
// get and set methods
Object.defineProperty(target, decoratedPropertyName, {
/**
* SessionStorage for storing string values
*/
export function SessionStorage(
target: Object, // The prototype of the class
decoratedPropertyName: string // The name of the property
) {
// get and set methods
Object.defineProperty(target, decoratedPropertyName, {
export class SomeComponent {
/** Attributes */
@LocalStorage
public variableToBeStored: string;
}
var Api = function() {
var url = 'https://query.yahooapis.com/v1/public/yql';
var query = 'env "store://datatables.org/alltableswithkeys"; select * from yahoo.finance.historicaldata where symbol = "AAPL" and startDate = "2016-01-01" and endDate = "2017-01-01"';
var def = new $.Deferred();
this.getData = function() {
$.ajax({
'url': url,
'data': {
@molcik
molcik / API.java
Last active January 8, 2017 18:19
package api;
import com.ib.controller.ApiController;
import java.util.ArrayList;
public class API implements ApiController.IConnectionHandler {
static API INSTANCE = new API();
Logger m_inLogger = new Logger();
Logger m_outLogger = new Logger();
package api;
import com.ib.controller.ApiConnection.ILogger;
public class Logger implements ILogger {
@Override
public void log(String valueOf) {
System.out.print(valueOf);
}
function run(input) {
var output = "http://translate.google.com/#en/cs/" + encodeURIComponent(input)
return output;
}