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 / local.conf
Last active November 5, 2022 17:33
Linux font rendering tweak that fixes fonts in Firefox.
<!-- Save this config as /etc/fonts/local.conf (or similar, related to your distro) and reboot system or run fc-cache -->
<!-- For better font rendering is good to install package freetype-freeworld -->
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign">
<bool>true</bool>
</edit>
@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 / smoothstep.swift
Last active August 31, 2019 11:49
SmoothStep implementation in Apple Swift
// SmoothStep implementation in Apple Swift
// Based on Wikipedia page https://en.wikipedia.org/wiki/Smoothstep
import Foundation
// Returns the input value clamped to the lower and higher limits
func clamp<T: Comparable>(value: T, low: T, high: T) -> T {
return min(max(value, low), high)
}
@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