Skip to content

Instantly share code, notes, and snippets.

View dvinciguerra's full-sized avatar
:octocat:
Bite my shine metal class!!!

Daniel Vinciguerra dvinciguerra

:octocat:
Bite my shine metal class!!!
View GitHub Profile

FWIW: I (@Rondy) am not the author of the content presented here, which is an outline from Edmond Lau's book. I've just copy-pasted it from somewhere and saved as a personal gist, before it got popular on newsnews.ycombinator.com. I don't remember where exactly the original source is from and neither could find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

@dvinciguerra
dvinciguerra / grav-cms-change-editor.js
Created December 26, 2022 16:53
Grav CMS editor hack (change to a wysiwyg)
// prepare editor resources
editor = {
script: '<script src="https://uicdn.toast.com/editor/latest/toastui-editor-all.min.js"></script>',
style: '<link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor.min.css" />',
}
// inject editor source in grav webpage
body = document.querySelector('body')
body.insertAdjacentHTML('beforeend', editor.style)
body.insertAdjacentHTML('beforeend', editor.script)
@dvinciguerra
dvinciguerra / esp8266.h
Created July 24, 2022 18:19
ESP8266 pin mapping
/**
* Reference:
* https://randomnerdtutorials.com/esp8266-pinout-reference-gpios
*/
// esp8266-01
// #define GPIO0 00
// #define GPIO1 01
// #define GPIO2 02
// #define GPIO3 03
@dvinciguerra
dvinciguerra / update_all_repositories.rb
Last active July 22, 2022 15:09
Ruby script to update all git repositories recursively
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'logger'
# globals
$stdout.sync = true
$logger = Logger.new($stdout)
# arguments
@dvinciguerra
dvinciguerra / itamae_environment.md
Created June 8, 2022 14:17 — forked from imksoo/itamae_environment.md
Itamaeで擬似的にEnvironmentを再現する

Itamaeで擬似的にEnvironmentを設ける時の書き方

Itamae実行時にノードアトリビュートを与えて実行する(itamae -y node.yaml recipe.rb or itamae -j node.json recipe.rb)が、 そのノードアトリビュート内部で擬似的にEnvironment変数を設定しておく。

# nodes/hogehoge-web-server.yaml
environment: development
cookbooks:
    - dnsmasq
@dvinciguerra
dvinciguerra / rubocop.yml
Created June 4, 2022 18:26 — forked from lazaronixon/rubocop.yml
Basecamp Rubocop Template
# This template is inspired on https://github.com/basecamp/audits1984/blob/master/.rubocop.yml
#
# 1 - Add dependencies to group :development, :test
# gem "rubocop", "~> 1.26", require: false
# gem "rubocop-performance", require: false
# gem "rubocop-rails", require: false
#
# 2 - Create a file .rubocop.yml and add the lines below
# inherit_from: https://gist.githubusercontent.com/lazaronixon/7815d84702f277ead5e89c9f2aa5581f/raw/rubocop.yml
#
@dvinciguerra
dvinciguerra / markdown.md
Created May 31, 2022 12:36 — forked from lcuevastodoit/markdown.md
MiniTest quick reference

MiniTest::Spec

use must for positive expectations and wont for negative expectations.

  • must_be | list.size.must_be :==, 0
  • must_be_close_to | subject.size.must_be_close_to 1,1
  • must_be_empty | list.must_be_empty
  • must_be_instance_of | list.must_be_instance_of Array
  • must_be_kind_of | list.must_be_kind_of Enumerable
@dvinciguerra
dvinciguerra / recipe.rb
Created April 23, 2022 03:39
Termux recipe using Itamae
class Specinfra::Helper::DetectOs::Termux < Specinfra::Helper::DetectOs
def detect
if (termux_properties = run_command('cat /data/data/com.termux/files/usr/share/examples/termux/termux.properties')) && termux_properties.success?
distro ||= 'termux'
release ||= ''
{ :family => 'termux', :release => release }
end
end
end
@dvinciguerra
dvinciguerra / keybase.md
Created March 20, 2022 02:53
keybase.md

Keybase proof

I hereby claim:

  • I am dvinciguerra on github.
  • I am dvinciguerra (https://keybase.io/dvinciguerra) on keybase.
  • I have a public key ASCSLBH7BJoY-I6bIajIRVnrneYFpzMjldWhCCDXsgm-Pgo

To claim this, I am signing this object:

@dvinciguerra
dvinciguerra / .solargraph.yml
Created February 22, 2022 21:14
.solargraph.yml
---
include:
- "**/*.rb"
- Rakefile
- "**/*.rake"
- Gemfile
- "**/*.gemspec"
exclude:
- spec/**/*
- test/**/*