This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Uses ruby to encode JSON, watchman to watch for changes, git-big-picture to output the image. | |
# Can be improved by watching only file creation/deletion, since content changes are irrelevant. | |
CURRENT_PATH=`pwd` | |
JSON=`HEADS_PATH="$CURRENT_PATH/.git/logs/refs/heads" ruby -e "require 'json'; puts JSON.dump ENV['HEADS_PATH']"` | |
watchman -j <<-EOT | |
["watch", $JSON] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cs: | |
number: | |
format: | |
separator: ',' | |
delimiter: ' ' | |
precision: 2 | |
date: | |
input: | |
formats: | |
- :default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Reads a mail from stdin, saves it to a new timestamped file and raises | |
# an macOS system notification. Can be used with PHP by entering this | |
# scripts path as a sendmail_path PHP INI variable. If used this way, | |
# from a webserver PHP instalation, make sure that the _www user has | |
# sufficent rights to execute the script and to write to the DIR_PATH | |
# folder. Also note that Dir.home returns the current user’s homedir. | |
# That means that if run by _www, it would return /Library/WebServer. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pokud ti nejde v Atomu na Windows s českou klávenicí napsat hvězdička, | |
# zkus postupovat podle tohoto návodu: | |
# | |
# 1. V atomu zvol v nabídce File › Keymap… | |
# Otevře se ti textový soubor s hromadou šedého textu. | |
# 2. Na konec tohoto souboru vlož dva řádky uvedené na konci tohoto | |
# návodu. | |
# 3. Soubor ulož, například klávesovou zkratkou Ctrl-S. | |
# | |
# Teď už by mělo být možné napsat hvězdičku stiskem Ctrl-Alt-pomlčka, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Maybe | |
{ | |
/** | |
* @var mixed|null | |
*/ | |
public $value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyClass | |
{ | |
use MyFirstTrait; | |
} | |
// This does not work. MyFirstTrait should use MySecondTrait, "Fatal error: | |
// Trait 'MyFirstTrait' not found" is raised instead. | |
trait MyFirstTrait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raise "Ruby versions less than 2.3.1 are unsupported!" if RUBY_VERSION < "2.3.1" | |
source 'https://rubygems.org' | |
# | |
# VMDB specific gems | |
# | |
gem "manageiq-gems-pending", ">0", :require => 'manageiq-gems-pending', :git => "https://github.com/ManageIQ/manageiq-gems-pending.git", :branch => "master" | |
# Modified gems for gems-pending. Setting sources here since they are git references |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** override_gem: manageiq-providers-ansible_tower, [{:path=>"/Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq-providers-ansible_tower"}], caller: /Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq/bundler.d/custom.rb | |
** override_gem: ansible_tower_client, [{:path=>"/Users/stomsa/Vývoj/ManageIQ/Repozitáře/ansible_tower_client_ruby"}], caller: /Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq/bundler.d/custom.rb | |
** override_gem: manageiq-schema, [{:path=>"/Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq-schema"}], caller: /Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq/bundler.d/custom.rb | |
** override_gem: manageiq-ui-classic, [{:path=>"/Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq-ui-classic"}], caller: /Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq/bundler.d/custom.rb | |
bower manageiq-ui-components#bower-dev not-cached https://github.com/ManageIQ/ui-components.git#bower-dev | |
bower manageiq-ui-components#bower-dev resolve https://github.com/ManageIQ/ui-components.git#bower-dev | |
bower jquery.observ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(File.realpath('.').each_char.map do |char| char.ascii_only? ? char : "\\u#{char.ord.to_s(16).rjust(4, '0')}" end).join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Practical demo showing manual UTF-8 decoding. Ispired by an article by Tim Bray [Characters vs. | |
# Bytes](http://www.tbray.org/ongoing/When/200x/2003/04/26/UTF). | |
# These are characters mentioned in the article. Their UTF-8 represenation is written as an array of hex-encoded bytes. | |
utf8_chars = [ | |
%w(26), # & | |
%w(D0 96), # Ж | |
%w(E4 B8 AD), # 中 | |
%w(F0 90 8D 86) # 𐍆 | |
] |