Skip to content

Instantly share code, notes, and snippets.

View ricaun's full-sized avatar

Luiz Henrique Cassettari ricaun

View GitHub Profile
@mikehadlow
mikehadlow / Program.cs
Created April 28, 2022 16:10
Attach Event Handlers By Reflection
namespace EventHandlersByReflection;
using System.Reflection;
using static System.Console;
public class Program
{
public static void Main()
{
var thing = new ThingWithEvents();
@MarcoEidinger
MarcoEidinger / TableWithCodeTipsAndExamples.md
Last active April 10, 2025 14:42
Master GitHub markdown tables with code blocks

Master GitHub markdown tables with code blocks

  1. Use HTML tags to define the table to get the best layout result
  2. Use either backticks (```) or the HTML pre element with attribute lang
  3. Keep a blank line before and after a code block for correct formatting and syntax highlighting

Good

Example: nice looking table to show HTTP Responses

@adimancv
adimancv / css_dark_mode_gist_embed_code.css
Last active April 7, 2025 21:12
CSS Dark Mode Gist Embed Code
/*!
* Gist DarkCode ver 0.2.1
* Update 03/12/2021 www.adiman.web.id
*/
.gist{font-size: 18px}.gist-meta, .gist-file, .octotree_toggle, ul.comparison-list > li.title,button.button, a.button, span.button, button.minibutton, a.minibutton,span.minibutton, .clone-url-button > .clone-url-link{background: linear-gradient(#202020, #181818) !important;border-color: #383838 !important;border-radius: 0 0 3px 3px !important;text-shadow: none !important;color: #b5b5b5 !important}.markdown-format pre, .markdown-body pre, .markdown-format .highlight pre,.markdown-body .highlight pre, body.blog pre, #facebox pre, .blob-expanded,.terminal, .copyable-terminal, #notebook .input_area, .blob-code-context,.markdown-format code, body.blog pre > code, .api pre, .api code,.CodeMirror,.highlight{background-color: #1D1F21!important;color: #C5C8C6!important}.gist .blob-code{padding: 1px 10px !important;text-align: left;background: #000;border: 0}::selection{background: #24890d;color: #fff;text-shadow: none}::-moz-selection{background:
@iamshreeram
iamshreeram / php-ssl-install.sh
Created December 30, 2018 06:41
Installing SSL certificate in hostinger
# Installation of SSL Certificate
## Enable SSH :
ssh [email protected] -p 65002
## Download acme-client
git clone https://github.com/kelunik/acme-client
## Install composer
```
@tomtor
tomtor / STM32-OTA.ino
Last active October 14, 2022 12:46
STM32 OTA Example
/*******************************************************************************
Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
(c) 2017 Tom Vijlbrief
Permission is hereby granted, free of charge, to anyone
obtaining a copy of this document and accompanying files,
to do whatever they want with them without any restriction,
including, but not limited to, copying, modification and redistribution.
NO WARRANTY OF ANY KIND IS PROVIDED.
@wjmazza
wjmazza / google-sheets-colour-preview.js
Last active October 6, 2024 22:51 — forked from Pathoschild/google-sheets-color-preview.js
A Google Sheets script which adds colour preview to cells. When you edit a cell containing a valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to that colour and the font colour will be changed to the inverse colour for readability.
/*
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a
valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to
that colour and the font colour will be changed to the inverse colour for readability.
To use this script in a Google Sheets spreadsheet:
1. go to Tools » Script Editor » Spreadsheet;
2. erase everything in the text editor;
3. change the title to "Set colour preview on edit";
@teocomi
teocomi / revit-addin-locations.txt
Last active March 6, 2025 09:09
Revit Addin folder location
Autodesk Revit addins are generally loaded from the following locations.
User Addins:
%appdata%\Autodesk\Revit\Addins\
%appdata%\Autodesk\ApplicationPlugins\
Machine Addins (for all users of the machine):
C:\ProgramData\Autodesk\Revit\Addins\
Addins packaged for the Autodesk Exchange store:
@kakopappa
kakopappa / WindowUtil.cs
Created March 4, 2016 06:26
How to get the parent window title using child window handle
[DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)]
static extern IntPtr GetParent(IntPtr hWnd);
[DllImport("user32", CharSet = CharSet.Auto, SetLastError = true)]
static extern int GetWindowText(IntPtr hWnd, [Out, MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpString, int nMaxCount);
public static String GetWindowTitle(IntPtr handle) {
IntPtr windowParent = IntPtr.Zero;
while (handle != IntPtr.Zero) {
@chrisblakley
chrisblakley / server-side-ga-events.php
Last active September 18, 2024 13:10
PHP functions to send data to Google Analytics
//Parse the GA Cookie
function gaParseCookie() {
if (isset($_COOKIE['_ga'])) {
list($version, $domainDepth, $cid1, $cid2) = explode('.', $_COOKIE["_ga"], 4);
$contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1 . '.' . $cid2);
$cid = $contents['cid'];
} else {
$cid = gaGenerateUUID();
}
return $cid;
@meziantou
meziantou / EnumExtension.cs
Last active August 11, 2024 17:38
WPF Enum
[MarkupExtensionReturnType(typeof(IEnumerable<LocalizedValue>)]
public class EnumExtension : MarkupExtension
{
public EnumExtension()
{
}
public EnumExtension(Type enumType)
{
this.EnumType = enumType;