Skip to content

Instantly share code, notes, and snippets.

View kubadlo's full-sized avatar

Jakub Leško kubadlo

View GitHub Profile
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
#include <Servo.h>
#define MAX_SIGNAL 2000
#define MIN_SIGNAL 700
#define MOTOR_PIN 9
Servo motor;
void setup() {
motor.attach(MOTOR_PIN);
@kubadlo
kubadlo / 20-intel.conf
Created July 15, 2015 17:27
Teer free video option for Intel graphic cards.
# Save this file as /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true"
EndSection
@kubadlo
kubadlo / chessboard.java
Created January 9, 2016 16:55
Knigh's tour solution.
package main;
import java.awt.Point;
public class Chessboard {
private final int KNIGHT_MOVES_COUNT = 8;
private final int[][] KNIGHT_MOVES = {
{1,-2},
{2,-1},
{2,1},
@kubadlo
kubadlo / gh-pages-deploy.md
Created July 6, 2016 06:38 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@kubadlo
kubadlo / typescript-style.xml
Created September 13, 2017 06:24
TypeScript enhancements for IntelliJ IDEA/WebStorm
<code_scheme name="Project">
<TypeScriptCodeStyleSettings>
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</TypeScriptCodeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
</codeStyleSettings>
</code_scheme>
package com.jakublesko;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
public class Challenge337 {
private BufferedImage sourceImage;
@kubadlo
kubadlo / .editorconfig
Last active February 3, 2018 16:39
Java project defaults
# Top most editorconfig
root = true
# General configuration
[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
@kubadlo
kubadlo / firefox_colors.md
Last active June 6, 2018 07:03
List of my favorite color settings for Firefox browser
@kubadlo
kubadlo / PortletUtils.java
Last active October 17, 2018 11:21
Simple util class to create various URLs in Spring MVC controllers used in Liferay portlets.
package sk.o2.assistant.portlet.common.util;
import javax.portlet.PortletURL;
import javax.portlet.RenderResponse;
import javax.portlet.ResourceURL;
public final class PortletUtils {
private static final String PORTLET_ACTION_NAME = "javax.portlet.action";