Skip to content

Instantly share code, notes, and snippets.

USE master
GO
IF OBJECT_ID ('sp_hexadecimal') IS NOT NULL
DROP PROCEDURE sp_hexadecimal
GO
CREATE PROCEDURE sp_hexadecimal
@binvalue varbinary(256),
@hexvalue varchar (514) OUTPUT
AS
DECLARE @charvalue varchar (514)
$template = @"
namespace AxlNetClient
{{
public partial class AXLPortClient
{{
private static AXLPortClient{0} _axlPortClient{0};
private static AXLPortClient{0} axlPortClient{0} => _axlPortClient{0} == null ||
_axlPortClient{0}.State != System.ServiceModel.CommunicationState.Opened ? (_axlPortClient{0} = LoadClient{0}()) : _axlPortClient{0};
@jamessantiago
jamessantiago / PandocConvertor.py
Created March 7, 2016 08:31
Modified Pandoc Converter Sublime Text Plugin
# A Sublime Text plugin to convert a Pandoc document into multiple formats:
# - html
# - docx
# - pdf
# - beamer
#
# The plug-in also deal with options embedded in the file to add more functions
# such as a table of content, a bibliography or enumerate sections.
#
# Different bibliography styles and templates could be chosen.
@jamessantiago
jamessantiago / SetBackground.ps1
Last active March 3, 2017 11:56
Copies to lockscreen, copies to desktop, applies watermark, detects and applies closest resolution
#expected to be executed from a folder with wallpapers in the format of BackGroundWIDTHxHEIGHT.jpg (e.g. Background1920x1200.jpg)
$consoleDebug = $true
$remoteDebug = $false
$LogFile = "$($env:temp)\Wallpaper_$([int]((get-date -UFormat "%s") / 86400)).log"
Function LogMessage($message)
{
if ($consoleDebug)
{
@jamessantiago
jamessantiago / CleanupScreens.ps1
Created October 25, 2014 11:45
Powershell Screen Recording Scripts
ls D:\Code\PSRec\Screenshots |% {
$thisHash = identify -quiet -format "%#" $_.FullName
if ($thisHash -eq $lastHash) {
rm $_.FullName
write-host "Removed duplicate $($_.FullName)"
}
$lastHash = $thisHash
}
@jamessantiago
jamessantiago / GenerateResolutions.ps1
Created October 14, 2014 06:58
Generate Background resolutions for windows lock screen
[reflection.assembly]::LoadWithPartialName("System.Drawing") | Out-Null
#1920x1200 is the starting image, doesn't have to be this resolution
$baseImage = New-Object system.drawing.bitmap $pwd\1920x1200.jpg
$files = @"
Background1024x1280.jpg
Background1024x1280.jpg
Background1024x768.jpg
Background1280x1024.jpg

Keybase proof

I hereby claim:

  • I am jamessantiago on github.
  • I am jamessantiago (https://keybase.io/jamessantiago) on keybase.
  • I have a public key whose fingerprint is 2D51 FA1E 42DE AF48 33FC 021D BAF3 C497 EC8C F91C

To claim this, I am signing this object:

@jamessantiago
jamessantiago / timbo.ps1
Last active August 29, 2015 14:05
Timbo Shell
Add-Type @"
using System;
using System.Runtime.InteropServices;
public class Tricks {
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
}
"@
1..60 |% {
@jamessantiago
jamessantiago / Get-DiskUsage.psm1
Last active January 1, 2016 12:59
Example psm1 script for use with the MMBot.Powershell package
function Get-DiskUsage {
<#
.SYNOPSIS
Gives details on disk free space
.DESCRIPTION
Returns a list of drives on the local machine
.NOTES
Name: Get-DiskUsage
Author: James Santiago
DateCreated: 08/21/2013
@jamessantiago
jamessantiago / PowershellModule.csx
Created December 27, 2013 06:47
MMBot script for use with the MMBot.Powershell package
//Notes:
//Requires the MMBot.Powershell nuget package
//Specify the powershell scripts folder using the MMBOT_POWERSHELL_SCRIPTSPATH key in the ini file
//Powershell scripts must be .psm1 (modules) to be executed
//Only scripts inside the scripts folder may be executed using this script
//Output objects must either support a ToString method or be a string to display properly
using MMBot.Powershell;
var robot = Require<Robot>();