Skip to content

Instantly share code, notes, and snippets.

View piotrkubisa's full-sized avatar
🐱
Set status

Piotr Kubisa piotrkubisa

🐱
Set status
View GitHub Profile
@piotrkubisa
piotrkubisa / Main.elm
Last active July 25, 2016 18:27
Recursive module in Elm with update
module Categories exposing (Model, Msg, init, update, view)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onInput, onClick)
type alias Model =
{ entry : String
, path : Path
@piotrkubisa
piotrkubisa / Categories.elm
Last active June 20, 2019 21:27
Elm nesting with recursive types.
module Categories exposing (Model, Msg, init, update, view)
import Html exposing (..)
import Html.Attributes exposing (style)
import Html.Events exposing (onInput, onClick)
type alias Model =
{ entry : String
, children : Children
import Html exposing (Html, Attribute, input, strong, ul, li, em, div, text, button)
import Html.App as Html
import Html.Attributes exposing (..)
import Html.Events exposing (onInput, onClick)
main =
Html.beginnerProgram { model = model, view = view, update = update }
-- MODEL
@piotrkubisa
piotrkubisa / rocketeerv2.bash
Last active August 4, 2016 06:51
Rocketeer v2 for Ubuntu Xenial Xerus 16.04
# set default locales for system
sudo export LANGUAGE=en_US.UTF-8
sudo export LANG=en_US.UTF-8
sudo export LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
# utils
sudo apt-get update
sudo apt-get install -y zsh git curl tree aptitude
@piotrkubisa
piotrkubisa / page-up-down-home-end-osx.sh
Created October 24, 2015 18:04
Set windows-like page-up, page-down, home, end key bindings globally on OS X like a sir (using just one script).
#!/usr/bin/env
cd "$HOME/Library/"
mkdir -p "KeyBindings"
cd KeyBindings
file="DefaultKeyBinding.dict"
if [ -e $file ]; then
echo "Error: File already exists! In aware of conflicts please review insertion manually."
@piotrkubisa
piotrkubisa / addhost.sh
Created September 10, 2015 17:08
Add quickly record to /etc/hosts
#!/bin/bash
# http://matthewhutchinson.net/2011/1/10/configuring-subdomains-in-development-with-lvhme
SUBDOMAIN=$1
TLD=$2
if [ $# -lt 1 ]
then
echo "which subdomain?"
read SUBDOMAIN
if [ -n "$SUBDOMAIN" ]
@piotrkubisa
piotrkubisa / DisableOneDrive.bat
Created August 15, 2015 17:56
Disable OneDrive on WIndows10
REM https://www.reddit.com/r/Windows10/comments/3f38ed/guide_how_to_disable_data_logging_in_w10
@echo off
cls
set x86="%SYSTEMROOT%\System32\OneDriveSetup.exe"
set x64="%SYSTEMROOT%\SysWOW64\OneDriveSetup.exe"
echo Closing OneDrive process.
echo.
taskkill /f /im OneDrive.exe > NUL 2>&1
@piotrkubisa
piotrkubisa / noRedirect.user.js
Last active February 26, 2019 03:23
Prevent redirecting JS feature. Packed in user.js
// ==UserScript==
// @name noRedirect
// @namespace https://gist.github.com/piqus/4ea4664519a83d7fb073
// @version 0.1
// @description Prevent redirecting JS feature. Packed in user.js
// @match *
// @copyright 2014+, Piotr Kubisa
/// @link: http://stackoverflow.com/questions/5225964/jquery-disable-all-redirections-links-form-submissions-window-location-change
// ==/UserScript==
@piotrkubisa
piotrkubisa / MoqupsSidebarToggle.user.js
Last active August 29, 2015 14:03
UserScript (TaperMonkey). Toggle sidebar with stencils on moqups.com to make display wider!
// ==UserScript==
// @name MoqupsSidebarToggle
// @namespace https://gist.github.com/piqus/8d026e5176a550d7ff4c
// @version 0.1
// @description Show/Hide left sidebar with stencils on moqups.com to make display wider!
// @match https://moqups.com/*
// @copyright 2014+, Piotr Kubisa
// ==/UserScript==
var isSidebarHidden = false;
@piotrkubisa
piotrkubisa / bfp4fGameEventStats.json
Created April 13, 2014 14:52
Battlefield Play4Free "GameEventStats" revealed.
{"GameEventStats": {
"12": "Roadkills",
"16": "Headshots",
"24": "Double kills",
"25": "Triple kills",
"26": "Multi kills",
"27": "Defensive kills",
"28": "Offensive kills",
"29": "Flags captured",
"30": "Driver kill assists",