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
@dvinciguerra
dvinciguerra / gist:700682c7755ad14ad774d425141a662b
Created April 9, 2024 16:22 — forked from pulcheri/gist:2498951
Perl one-liner strings replace
first=$1
second=$2

# Replace
find -name *.cpp -or -name *.h | xargs grep "$first" -l  | xargs perl -pi -e "s/$first/$second/g"

a=getDefaultIncludes; b=get_include_dirs_def; find -name "*.py" -or -name "SC*" | xargs grep "$a" -l  | xargs perl -pi -e "s/$a/$b/g"

a=abc; b=def; find -name "*.cpp" -or -name "*.h" | xargs grep "$a" -l | xargs perl -pi -e "s/$a/$b/g"
@dvinciguerra
dvinciguerra / bot
Last active November 10, 2023 02:12
Ruby ChatGPT CLI to ask things without leave terminal
#!/usr/bin/env ruby
# _ _
# | |__ ___| |_
# | '_ \ _ \ _|
# |_.__\___/\__|
# Ruby ChatGPT CLI to ask things without leave terminal
# by dvinciguerra
require 'bundler/inline'
@dvinciguerra
dvinciguerra / twitch_channel_current_in_live.rb
Last active September 26, 2023 21:44
Twitch cli to check if channel is online without accessing browser or receive a push notification
# frozen_string_literal: true
require 'faraday'
require 'json'
require 'logger'
require 'oga'
require 'pastel'
module Twitch
module PageLoader
@dvinciguerra
dvinciguerra / custom.css
Created August 15, 2023 21:36
My personal Logseq Dracula theme customizations (based on oficial dracula theme)
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap');
:root {
--background: #282a36;
--light-background: #343746;
--lighter-background: #424450;
--dark-background: #21222c;
--darker-background: #191a21;
--foreground: #f8f8f2;
--current-line: #44475a;

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 / 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 / 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
@exorcistas
exorcistas / SciTEUser.properties
Created April 23, 2022 19:49
My Dracula theme settings for SciTE editor
font.base=font:Courier New,size:11,$(font.override)
font.monospace=font:Consolas,size:12
selection.fore=#E6E4FA
selection.back=#9488C8
selection.alpha=50
style.*.32=style.*.32=$(font.base),back:#F0F4F9
caret.line.back=#FDF268
caret.line.back.alpha=21
style.au3.34=fore:#DC78BB,back:#282A36
style.au3.35=fore:#4F72A4,back:#282A36