Skip to content

Instantly share code, notes, and snippets.

View araujofrancisco's full-sized avatar
🏠
Working from home

Francisco Araujo araujofrancisco

🏠
Working from home
View GitHub Profile
@fushnisoft
fushnisoft / clariondate.sql
Last active January 5, 2024 14:33
Convert a Clarion Date (INT) to SQL DateTime
DECLARE @ClarionDate INT = 47563
DECLARE @SqlDateTime DATETIME
-- Convert the clarion DATE into and SQL DateTime
SET @SqlDateTime = DateAdd(day, @ClarionDate - 4, '1801-01-01')
SELECT @SqlDateTime AS 'SQL Date Time'
-- Now convert it back from and SQL DateTime to a Clarion Date
SET @ClarionDate = DateDiff(day, DateAdd(day, -4, '1801-01-01'), @SqlDateTime)
@xtrasmal
xtrasmal / clickable-grid.css
Created July 24, 2013 16:42
JS/HTML Clickable grid
.grid { margin:1em auto; border-collapse:collapse }
.grid td {
cursor:pointer;
width:30px; height:30px;
border:1px solid #ccc;
text-align:center;
font-family:sans-serif; font-size:13px
}
.grid td.clicked {
background-color:yellow;
@jokey2k
jokey2k / sshfilter.sh
Last active April 22, 2024 14:18
Tuned version of sshfilter.sh to allow for ipv6 filtering
#!/bin/bash
# based on script from http://www.axllent.org/docs/view/ssh-geoip
# License: WTFPL
# UPPERCASE space-separated country codes to ACCEPT
ALLOW_COUNTRIES="DE EU GB"
LOGDENY_FACILITY="authpriv.notice"
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` <ip>" 1>&2
@DanielSWolf
DanielSWolf / Program.cs
Last active July 16, 2024 20:29
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@airstrike
airstrike / mute-mic.ahk
Last active December 29, 2023 22:08
AutoHotkey | Toggle microphone hotkey script (Windows+U)
;
; AutoHotkey Version: v1.1.22.06
; Language: English
; Platform: Windows 10
; Author: Andy Terra <github.com/airstrike>
;
; Script Function:
; Toggle Microphone Mute -- assumes it is located at WAVE:1, device #2
; Use the SoundCardAnalysis script to figure out where your mic is
; https://www.autohotkey.com/docs/commands/SoundSet.htm#Ex
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
#NoEnv
SetBatchLines, -1
#MaxHotkeysPerInterval 200
#Include <VA>
; Create the slider window
Gui, Add, Progress, w100 h20 x0 y0 Range0-100 vVolSlider, 0
Gui, Add, Text, w100 h20 x0 y0 vVolText BackgroundTrans Center +0x200, 0
Gui, +AlwaysOnTop -Caption +ToolWindow
Gui, Show, Hide w100 h20 x0 y0, Volume
@conficient
conficient / BlazorModalExample.razor
Last active February 14, 2024 12:30
Blazor Modal Dialog with no JS interop
<button class="btn btn-primary" @onclick="@ModalShow">Show Dialog!</button>
@if (showModal)
{
<div class="modal fade show" id="myModal" style="display:block" aria-modal="true" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
@zoilomora
zoilomora / README.md
Last active June 28, 2024 04:59
How to disable cloud-init in Ubuntu

How to disable cloud-init in Ubuntu

Prevent start

  • Create an empty file to prevent the service from starting

      sudo touch /etc/cloud/cloud-init.disabled
    

Uninstall

@SteveSandersonMS
SteveSandersonMS / blazor-state-user-docs.md
Last active February 29, 2024 02:46
Preserving State in Server-Side Blazor applications

Preserving State in Server-Side Blazor applications

Server-side Blazor is a stateful application framework. Most of the time, your users will maintain an ongoing connection to the server, and their state will be held in the server's memory in what's known as a "circuit". Examples of state held for a user's circuit include:

  • The UI being rendered (i.e., the hierarchy of component instances and their most recent render output)
  • The values of any fields and properties in component instances
  • Data held in DI service instances that are scoped to the circuit

Occasionally, users may experience a temporary network connection loss, after which Blazor will attempt to reconnect them to their original circuit so they can continue.