Skip to content

Instantly share code, notes, and snippets.

View fushnisoft's full-sized avatar

Brahn Partridge fushnisoft

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)
@fushnisoft
fushnisoft / ConsoleSupport.clw
Created September 19, 2013 15:05
Clarion console app!
Member()
Include('ConsoleSupport.inc'),ONCE
Map
MODULE('32-bit Windows API')
! General functions
GetLastError(),DWORD,PASCAL
! Console functions
GetStdHandle(DWORD),HANDLE,PASCAL,PROC,RAW
WriteConsole(Handle,Long,Dword,long,long),bool,Raw,Pascal,name('WriteConsoleA')
@fushnisoft
fushnisoft / fileupload.ps1
Last active January 19, 2022 08:03
Upload a file using powershell and the WinSCP .NET library with upload progress feedback
# Using the beta version of WinSCP http://winscp.net/eng/download.php
# Call this script to upload a file via FTP with progress feedback
# e.g.
# .\fileupload.ps1 -username "myusername" -password "mypassword" -localfile "C:\files\MyFile.exe" -remotefile "/public_html/files/MyFile.exe"
# NOTE: This script assumes the WinSCP binaries are in a sub directory to the script. You can probably pass that as a parameter to be more flexible.
param (
[string]$username,
[string]$password,
[string]$localFile,
@fushnisoft
fushnisoft / del.bat
Created April 19, 2012 10:48
Example pre-build script for cancelling build if exe file is already open
ECHO off
:delfile
del %1%
if exist %1% goto fail
goto end
:fail
ECHO Unable to delete %1%, you probably still have it open!
EXIT /B 1
:end
@fushnisoft
fushnisoft / msbuild example.md
Last active June 12, 2019 14:59
msbuild example for Clarion

msbuild example for Clarion

This is an example of how to build a Clarion multi dll project from the command line. This was useful to be able to correctly build a multi-dll project containing circular references.


The BAT file

There are two calls so everything gets compiled.

@fushnisoft
fushnisoft / VSDark.xml
Last active September 6, 2018 01:51
Make Clarion look a little bit like Visual studio. Install this clarion color scheme as "VSDark" and select it from Options-->IDE-->Appearance. Then, install the ClarionAddins SetTheme addin and apply the VSBlack theme from Options-->Clarion Addins-->Set IDE Theme.
<?xml version="1.0"?>
<AppearanceProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<DockTabStripAppearance>
<xGradientBegin>-13816528</xGradientBegin>
<xGradientEnd>-13816528</xGradientEnd>
<xTextColor>ControlDark</xTextColor>
</DockTabStripAppearance>
<DockPadTitleAppearance>
<xActiveBackColorGradientBegin>-16745780</xActiveBackColorGradientBegin>
<xActiveBackColorGradientEnd>-16745780</xActiveBackColorGradientEnd>
@fushnisoft
fushnisoft / clarionhub.addin
Last active May 18, 2018 13:09
Save this xml to a file (clarionhub.addin) in %cwroot%\accessory\addins\ and you will have a clarionhub link in your IDE menu!
<AddIn name = "ClarionHubMenu"
author = "ClarionHub"
url = "http://clarionhub.com"
copyright = ""
description = "">
<Manifest>
<Identity name="ClarionHubMenu.Addin" version="1.0"/>
<Dependency addin = "SharpDevelop" version = "2.1"/>
</Manifest>
using Hangfire;
using Microsoft.Owin;
using Microsoft.Owin.Hosting;
using Owin;
using Serilog;
using System;
using System.Data.SqlClient;
using Topshelf;
[assembly: OwinStartup(typeof(MyScheduler.Startup))]
MAP
GetVT_Type(*BYTE),LONG
GetVT_Type(*SHORT),LONG
GetVT_Type(*USHORT),LONG
GetVT_Type(*DATE),LONG
GetVT_Type(*TIME),LONG
GetVT_Type(*LONG),LONG
GetVT_Type(*ULONG),LONG
GetVT_Type(*SREAL),LONG
GetVT_Type(*REAL),LONG
@fushnisoft
fushnisoft / CBAltWin7Fix.TPL
Created January 19, 2017 00:51
A fix for the Alt key lockup problem with the latest version of Windows 10. This was written by Carl Barnes, and published in ClarionMag. Dave Harms has given permission for everyone to use it!! Thanks Dave!!!
#TEMPLATE (CBAltFix, 'Carl Barnes fix for Alt Key Lockup in Windows 7'),FAMILY('ABC','CW20')
#!===========================================================================
#! Warning! Version 2 of the template changes things.
#! The Global template AltWin7Fix_Global has been removed and is no longer needed.
#! The Frame template AltWin7Fix_Frame has been renamed because it has new questions
#! Only the Frame Extension template is required, it is where you specify all choices.
#! It has a new name AltWin7Fix_Frame2 so you must populate it again on the Frame.
#! If you used the first version of the template you will get errors when you open
#! an APP. Ignore the errors, you should open the Frame, go to Extenstions and add the new template.
#! *** Removed ===>#EXTENSION (AltWin7Fix_Global,'Fix Windows 7 Alt Key Lockup-Global-by Carl Barnes'), APPLICATION