arch -x86_64 gem install nokogiri -v '1.10.10' --platform=ruby -- --use-system-libraries
This file contains hidden or 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
| <html> | |
| <head> | |
| <title>Oops server is dead!</title> | |
| <style> | |
| html { | |
| background: #262b30; | |
| height: 100%; | |
| } | |
| body { |
This file contains hidden or 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
| # Monkey patch Ruby Array class | |
| # | |
| class Array | |
| def each_with_last | |
| size = self.size | |
| each_with_index do |e, index| | |
| yield(e, (index == size-1)) | |
| end | |
| end |
This file contains hidden or 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
| # data | |
| data = '''<?xml version="1.0" encoding="UTF-8"?> | |
| <menza> | |
| <date day="Monday"> | |
| <meal name="Potato flat cakes"> | |
| <ingredient name="potatoes"/> | |
| <ingredient name="flour"/> | |
| <ingredient name="eggs"/> | |
| </meal> | |
| <meal name="Pancakes"> |
This file contains hidden or 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
| # Rake Quick Reference | |
| # | |
| # Rake is amazing automation tools based on Ruby. | |
| # Rake open source documentation is pretty limited relative to the tool capability. | |
| # | |
| # It's better than Makefile because it's more dynamic. | |
| # while Makefile are pretty flexible, there are a lot of builtin rules | |
| # and conventions that must be follow. | |
| # This make pretty hard to learn, debug and scaling can be frustrating. | |
| # |
This file contains hidden or 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
| module Logging | |
| ESCAPES = { :green => "\033[32m", | |
| :yellow => "\033[33m", | |
| :red => "\033[31m", | |
| :reset => "\033[0m" } | |
| def info(message) | |
| emit(:message => message, :color => :green) | |
| end |
This file contains hidden or 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
| // after trying to build my own shortcut keyboard with arduino. | |
| // I realize that it would be time and cost effective to re-use a spare mechanical keyboard to execute my shortcut. | |
| // Karabiner offers a simple easy solution even it's a bit of twist. | |
| // | |
| // source: https://stackoverflow.com/questions/63194740/karabiner-elements-map-a-key-to-a-combination-keys | |
| // | |
| // edit: ~/.config/karabiner/karabiner.json | |
| // | |
| // Remap the secondary keyboard key d to command + d -> duplicate line in the VS code command palette | |
| "devices": [ |
If the parent script runs with fail on error switch: tcsh -e
but a sub script issue a exit code non zero.
Then the parent will fail like a Jenkins pipeline, Bamboo job or else.
This switch allows easy pipeline debug by stopping the script when exit code > 0
/bin/tcsh -fe
source path/to/bin/sourceme
# display each command executed
set echo
OlderNewer